Skip to content

Commit

Permalink
Handle namespace prefix on md:Extensions elements. Repair broken Disc…
Browse files Browse the repository at this point in the history
…overyService elements generated by some versions of the Shib 2 SP. Reorder some things to make them clearer.
  • Loading branch information
iay committed Jun 17, 2009
1 parent a578276 commit bac6067
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions build/import.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"
xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"
xmlns:ukfedlabel="http://ukfederation.org.uk/2006/11/label"

xmlns:ukfxd="xalan://uk.org.ukfederation.xalan.Dates"
Expand All @@ -37,7 +39,7 @@

xmlns:xalan="http://xml.apache.org/xalan"

exclude-result-prefixes="md xalan"
exclude-result-prefixes="idpdisc md xalan"

xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

Expand Down Expand Up @@ -224,6 +226,18 @@
</xsl:template>


<!--
md:Extensions
Normalise namespace prefix.
-->
<xsl:template match="md:Extensions">
<Extensions>
<xsl:apply-templates select="node()|@*"/>
</Extensions>
</xsl:template>


<!--
md:KeyDescriptor
Expand Down Expand Up @@ -328,6 +342,22 @@
<!-- do nothing -->
</xsl:template>


<!--
idpdisc:DiscoveryResponse
Normalise namespace prefix, add missing Binding attribute.
-->
<xsl:template match="idpdisc:DiscoveryResponse">
<DiscoveryResponse xmlns="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol">
<xsl:if test="not(@Binding)">
<xsl:attribute name="Binding">urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="node()|@*"/>
</DiscoveryResponse>
</xsl:template>


<!--By default, copy text blocks, comments and attributes unchanged.-->
<xsl:template match="text()|comment()|@*">
<xsl:copy/>
Expand Down

0 comments on commit bac6067

Please sign in to comment.