Last active
August 29, 2015 14:27
-
-
Save trscavo/90e15ec875c6925af31c to your computer and use it in GitHub Desktop.
An XSL stylesheet that extracts the entityIDs of the IdPs in a SAML 2.0 metadata file that support the Research & Scholarship Category
This file contains hidden or 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"?> | |
| <!-- | |
| extract_RandS_IdP_entityIDs.xsl | |
| XSL stylesheet that takes a SAML 2.0 metadata file and extracts | |
| the Research & Scholarship IdP entityIDs as plain text. | |
| See: http://refeds.org/category/research-and-scholarship | |
| --> | |
| <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:mdattr="urn:oasis:names:tc:SAML:metadata:attribute" | |
| xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" | |
| xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| exclude-result-prefixes="xs md"> | |
| <!-- Output is plain text --> | |
| <xsl:output method="text"/> | |
| <xsl:template match="//md:EntityDescriptor[md:Extensions/mdattr:EntityAttributes/saml:Attribute[@Name='http://macedir.org/entity-category-support']/saml:AttributeValue[text()='http://refeds.org/category/research-and-scholarship']]"> | |
| <xsl:value-of select="@entityID"/> | |
| <xsl:text>
</xsl:text> | |
| </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