Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
inc-meta/build/extract_addresses.xsl
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
45 lines (35 sloc)
1.42 KB
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"?> | |
<!-- | |
extract_addresses.xsl | |
XSL stylesheet that takes a SAML 2.0 metadata file and extracts | |
a list of contact e-mail addresses. Only administrative and | |
technical addresses are used; all others are dropped. | |
Author: Ian A. Young <ian@iay.org.uk> | |
--> | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" | |
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
exclude-result-prefixes="md ds"> | |
<!--Force UTF-8 encoding for the output.--> | |
<xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/> | |
<xsl:template match="/md:EntitiesDescriptor"> | |
<Addresses> | |
<xsl:apply-templates select="md:EntityDescriptor/md:ContactPerson"/> | |
</Addresses> | |
</xsl:template> | |
<xsl:template match="md:ContactPerson[@contactType='support']"> | |
<!-- do nothing --> | |
</xsl:template> | |
<xsl:template match="md:ContactPerson"> | |
<xsl:apply-templates select="md:EmailAddress"/> | |
</xsl:template> | |
<xsl:template match="md:EmailAddress"> | |
<EmailAddress><xsl:value-of select="."/></EmailAddress> | |
</xsl:template> | |
<!--By default, copy text blocks, comments and attributes unchanged.--> | |
<xsl:template match="text()|@*"> | |
<xsl:copy/> | |
</xsl:template> | |
</xsl:stylesheet> |