summaryrefslogtreecommitdiff
path: root/xslt/tidy.xsl
blob: 043ef07c95cb9eb8a6a35821b245d6d49e0c51a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?xml version="1.0"?>
<xsl:stylesheet version="2.0"
                xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="@ID"/>
  <xsl:template match="@validUntil"/>
  <xsl:template match="@cacheDuration"/>
  <xsl:template match="@xml:base"/>
  <xsl:template match="md:OrganizationName|md:OrganizationURL|md:OrganizationDisplayName">
     <xsl:if test="normalize-space(text()) != ''">
        <xsl:copy><xsl:apply-templates select="node()|@*"/></xsl:copy>
     </xsl:if>
  </xsl:template>

  <xsl:template match="text()|comment()|@*|node()">
    <xsl:copy>
       <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="/*">
    <xsl:element name="md:{local-name()}" namespace="urn:oasis:names:tc:SAML:2.0:metadata">
       <!-- xsl:namespace name="xsi" select="'http://www.w3.org/2001/XMLSchema-instance'"/ -->
       <xsl:namespace name="xs" select="'http://www.w3.org/2001/XMLSchema'"/>
       <xsl:apply-templates select="@*|node()"/>
    </xsl:element>
  </xsl:template>

</xsl:stylesheet>