Synch'd metadata transformation files from /c.
[java-idp.git] / src / schemas / metadata_v12_to_v11.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3         v12_to_v11.xsl
4         
5         XSL stylesheet converting a Shibboleth 1.2 sites metadata file into the equivalent for
6         Shibboleth 1.1.
7
8         Author: Ian A. Young <ian@iay.org.uk>
9
10         $Id$
11 -->
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:ds="http://www.w3.org/2000/09/xmldsig#"
16         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17         exclude-result-prefixes="shibb10">
18         
19         <!--
20                 Version information for this file.  Remember to peel off the dollar signs
21                 before dropping the text into another versioned file.
22         -->
23         <xsl:param name="cvsId">$Id$</xsl:param>
24
25         <!--
26                 Add a comment to the start of the output file.
27         -->
28         <xsl:template match="/">
29                 <xsl:comment>
30                         <xsl:text>&#10;&#9;***DO NOT EDIT THIS FILE***&#10;&#10;</xsl:text>
31                         <xsl:text>&#9;Converted by:&#10;&#10;&#9;</xsl:text>
32                         <xsl:value-of select="substring-before(substring-after($cvsId, ': '), '$')"/>
33                         <xsl:text>&#10;</xsl:text>
34                 </xsl:comment>
35                 <xsl:apply-templates/>
36         </xsl:template>
37
38         <!--Force UTF-8 encoding for the output.-->
39         <xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/>
40
41         <!--
42                 shibb10:SiteGroup is the root element for the sites file.  Process it by copying across everything except DestinationSite elements.
43         -->
44         <xsl:template match="shibb10:SiteGroup">
45                 <xsl:copy>
46                         <xsl:attribute name="xsi:schemaLocation">
47                                 <xsl:text>urn:mace:shibboleth:1.0 shibboleth.xsd</xsl:text>
48                         </xsl:attribute>
49                         <xsl:apply-templates select="@Name|text()|comment()|shibb10:OriginSite"/>
50                 </xsl:copy>
51         </xsl:template>
52
53         <!--By default, copy text blocks, comments and attributes unchanged.-->
54         <xsl:template match="text()|comment()|@*">
55                 <xsl:copy/>
56         </xsl:template>
57
58         <!--By default, copy all elements from the input to the output, along with their attributes and contents.-->
59         <xsl:template match="*">
60                 <xsl:copy>
61                         <xsl:apply-templates select="node()|@*"/>
62                 </xsl:copy>
63         </xsl:template>
64
65 </xsl:stylesheet>