Skip to content

Commit

Permalink
Initial checkin.
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed Jun 23, 2006
1 parent c2f1d48 commit 2079d79
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions build/master_to_wayf.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
master_to_wayf.xsl
XSL stylesheet that takes a SAML 2.0 metadata file and filters out
entities marked as hidden from the WAYF.
Author: Ian A. Young <ian@iay.org.uk>
$Id: master_to_wayf.xsl,v 1.1 2006/06/23 09:05:00 iay Exp $
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:shibmeta="urn:mace:shibboleth:metadata:1.0"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
exclude-result-prefixes="shibmeta md ds wayf">

<!--
Version information for this file. Remember to peel off the dollar signs
before dropping the text into another versioned file.
-->
<xsl:param name="cvsId">$Id: master_to_wayf.xsl,v 1.1 2006/06/23 09:05:00 iay Exp $</xsl:param>

<!--
Add a comment to the start of the output file.
-->
<xsl:template match="/">
<xsl:comment>
<xsl:text>&#10;&#9;***DO NOT EDIT THIS FILE***&#10;&#10;</xsl:text>
<xsl:text>&#9;Converted by:&#10;&#10;&#9;</xsl:text>
<xsl:value-of select="substring-before(substring-after($cvsId, ': '), '$')"/>
<xsl:text>&#10;</xsl:text>
</xsl:comment>
<xsl:apply-templates/>
</xsl:template>

<!--Force UTF-8 encoding for the output.-->
<xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/>

<!--
The WAYF does not need the key authority information for the federation.
We assume, for now, that this is the only extension on the EntitiesDescriptor
and just omit that entirely. If we ever start putting other extensions in at
that level, this would need to be revised.
-->
<xsl:template match="md:EntitiesDescriptor/md:Extensions">
<!-- do nothing -->
</xsl:template>

<!--
Any entity which has an entity-level extension element wayf:HideFromWAYF
is omitted from the output.
-->
<xsl:template match="md:EntityDescriptor[md:Extensions/wayf:HideFromWAYF]">
<!-- do nothing -->
</xsl:template>

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

<!--By default, copy all elements from the input to the output, along with their attributes and contents.-->
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

0 comments on commit 2079d79

Please sign in to comment.