1 <?xml version="1.0" encoding="UTF-8"?>
5 XSL stylesheet converting a Shibboleth 1.2 trust metadata file into the equivalent for
8 Author: Ian A. Young <ian@iay.org.uk>
12 <xsl:stylesheet version="1.0"
13 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
14 xmlns:shibb10="urn:mace:shibboleth:1.0"
15 xmlns:trust10="urn:mace:shibboleth:trust:1.0"
16 xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
17 xmlns="urn:mace:shibboleth:1.0"
18 exclude-result-prefixes="shibb10 trust10">
21 Version information for this file. Remember to peel off the dollar signs
22 before dropping the text into another versioned file.
24 <xsl:param name="cvsId">$Id$</xsl:param>
27 Add a comment to the start of the output file.
29 <xsl:template match="/">
31 <xsl:text> 	***DO NOT EDIT THIS FILE*** </xsl:text>
32 <xsl:text>	Converted by: 	</xsl:text>
33 <xsl:value-of select="substring-before(substring-after($cvsId, ': '), '$')"/>
34 <xsl:text> </xsl:text>
36 <xsl:apply-templates/>
39 <!--Force UTF-8 encoding for the output.-->
40 <xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/>
42 <!--trust10:Trust is the root element for the trust file. Process it by changing the default namespace used and recursing.-->
43 <xsl:template match="trust10:Trust">
45 <!-- <xsl:apply-templates select="@*"/> -->
46 <xsl:apply-templates/>
50 <!--trust10:KeyAuthority appears in the trust file, and needs its namespace changing. After that, we need to reorder its nested elements a little.-->
51 <xsl:template match="trust10:KeyAuthority">
53 <xsl:apply-templates select="ds:KeyInfo"/>
55 <xsl:value-of select="ds:KeyName"/>
61 Generic recursive copy for ds:* elements.
63 This works better than an xsl:copy-of because it does not copy across spurious
66 <xsl:template match="ds:*">
67 <xsl:element name="{name()}">
68 <xsl:apply-templates select="ds:* | text() | comment() | @*"/>
72 <!--By default, copy text blocks, comments and attributes unchanged.-->
73 <xsl:template match="text()|comment()|@*">
77 <!--By default, copy all elements from the input to the output, along with their attributes and contents.-->
78 <xsl:template match="*">
80 <xsl:apply-templates select="node()|@*"/>