Last active
May 15, 2017 21:43
-
-
Save trscavo/0c30a591c8fe85aec5c838bd3f83842a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
list_entity_roles_txt.xsl | |
This XSL transform takes a SAML metadata document and produces | |
a tab-separated list of triples: | |
(@entityID, roleDescriptor, @registrationAuthority) | |
where roleDescriptor is one of the following: | |
IDPSSODescriptor | |
SPSSODescriptor | |
AttributeAuthorityDescriptor | |
Note that a given entityID may appear multiple times since | |
an entity may assume multiple roles. | |
--> | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" | |
xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"> | |
<!-- Output is plain text --> | |
<xsl:output method="text"/> | |
<xsl:template match="/"> | |
<xsl:for-each select="//md:EntityDescriptor[md:IDPSSODescriptor]"> | |
<xsl:value-of select="./@entityID"/> | |
<xsl:text>	</xsl:text> | |
<xsl:text>IDPSSODescriptor</xsl:text> | |
<xsl:text>	</xsl:text> | |
<xsl:value-of select="./md:Extensions/mdrpi:RegistrationInfo/@registrationAuthority"/> | |
<xsl:text>
</xsl:text> | |
</xsl:for-each> | |
<xsl:for-each select="//md:EntityDescriptor[md:SPSSODescriptor]"> | |
<xsl:value-of select="./@entityID"/> | |
<xsl:text>	</xsl:text> | |
<xsl:text>SPSSODescriptor</xsl:text> | |
<xsl:text>	</xsl:text> | |
<xsl:value-of select="./md:Extensions/mdrpi:RegistrationInfo/@registrationAuthority"/> | |
<xsl:text>
</xsl:text> | |
</xsl:for-each> | |
<xsl:for-each select="//md:EntityDescriptor[md:AttributeAuthorityDescriptor]"> | |
<xsl:value-of select="./@entityID"/> | |
<xsl:text>	</xsl:text> | |
<xsl:text>AttributeAuthorityDescriptor</xsl:text> | |
<xsl:text>	</xsl:text> | |
<xsl:value-of select="./md:Extensions/mdrpi:RegistrationInfo/@registrationAuthority"/> | |
<xsl:text>
</xsl:text> | |
</xsl:for-each> | |
</xsl:template> | |
<xsl:template match="text()"> | |
<!-- do nothing --> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment