Use shibboleth-sp as package name for compatibility.
[shibboleth/cpp-sp.git] / configs / upgrade.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
3     xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
4     xmlns:oldconf="urn:mace:shibboleth:target:config:1.0"
5     xmlns:cred="urn:mace:shibboleth:credentials:1.0"
6     xmlns:conf="urn:mace:shibboleth:2.0:native:sp:config"
7     xmlns="urn:mace:shibboleth:2.0:native:sp:config"
8     exclude-result-prefixes="oldconf cred">
9
10     <xsl:param name="idp"/>
11     
12     <!--Force UTF-8 encoding for the output.-->
13     <xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8"/>
14
15     <xsl:variable name="spaces" select="string('                                                                                          ')"/>
16
17     <xsl:template match="/">
18         <xsl:apply-templates/>
19     </xsl:template>
20     
21     <xsl:template match="oldconf:SPConfig">
22         <xsl:text>&#10;</xsl:text>
23         <SPConfig logger="{@logger}" clockSkew="{@clockSkew}">
24             <xsl:text>&#10;</xsl:text>
25             <xsl:comment>
26                 <xsl:text> Generated by upgrade utility: check carefully before deploying. </xsl:text>
27             </xsl:comment>
28             <xsl:text>&#10;&#10;</xsl:text>
29             <xsl:apply-templates select="oldconf:Global"/>
30             <xsl:text>&#10;</xsl:text>
31             <xsl:apply-templates select="oldconf:Local"/>
32             <xsl:text>&#10;</xsl:text>
33             <xsl:apply-templates select="oldconf:Global/oldconf:UnixListener"/>
34             <xsl:apply-templates select="oldconf:Global/oldconf:TCPListener"/>
35             <xsl:text>&#10;    </xsl:text>
36             <xsl:comment>
37                 <xsl:text> This set of components stores sessions and other persistent data in daemon memory. </xsl:text>
38             </xsl:comment>
39             <xsl:text>&#10;    </xsl:text>
40             <StorageService type="Memory" id="mem" cleanupInterval="900"/>
41             <xsl:text>&#10;    </xsl:text>
42             <SessionCache type="StorageService" StorageService="mem" cacheTimeout="{oldconf:Global/oldconf:MemorySessionCache/@cacheTimeout}" inprocTimeout="900" cleanupInterval="900"/>
43             <xsl:text>&#10;    </xsl:text>
44             <ReplayCache StorageService="mem"/>
45             <xsl:text>&#10;    </xsl:text>
46             <ArtifactMap artifactTTL="180"/>
47             <xsl:text>&#10;&#10;    </xsl:text>
48             <xsl:comment>
49                 <xsl:text> This set of components stores sessions and other persistent data in an ODBC database. </xsl:text>
50             </xsl:comment>
51             <xsl:text>&#10;    </xsl:text>
52             <xsl:comment>
53                 <xsl:text>
54     &lt;StorageService type="ODBC" id="db" cleanupInterval="900"&gt;
55         &lt;ConnectionString&gt;DRIVER=drivername;SERVER=dbserver;UID=shibboleth;PWD=password;DATABASE=shibboleth;APP=Shibboleth&lt;/ConnectionString&gt;
56     &lt;/StorageService&gt;
57     &lt;SessionCache type="StorageService" StorageService="db" cacheTimeout="3600" inprocTimeout="900" cleanupInterval="900"/&gt;
58     &lt;ReplayCache StorageService="db"/&gt;
59     &lt;ArtifactMap StorageService="db" artifactTTL="180"/&gt;
60     </xsl:text>
61             </xsl:comment>
62             <xsl:apply-templates select="oldconf:Local/oldconf:RequestMapProvider"/>
63             <xsl:apply-templates select="oldconf:Applications"/>
64
65             <xsl:text>&#10;&#10;    </xsl:text>
66             <xsl:comment>
67                 <xsl:text> Policies that determine how to process and authenticate runtime messages. </xsl:text>
68             </xsl:comment>
69             <xsl:text>&#10;    </xsl:text>
70             <SecurityPolicyProvider type="XML" validate="true" path="security-policy.xml"/>
71             <xsl:text>&#10;&#10;</xsl:text>
72         </SPConfig>
73     </xsl:template>
74     
75     <!-- Turn <Global> into <OutOfProcess> with the ODBC extension commented out. -->
76     <xsl:template match="oldconf:Global">
77         <xsl:text>&#10;    </xsl:text>
78         <OutOfProcess logger="{@logger}">
79             <xsl:text>&#10;        </xsl:text>
80             <xsl:comment>
81                 <xsl:text>
82         &lt;Extensions&gt;
83            &lt;Library path="odbc-store.so" fatal="true"/&gt;
84         &lt;/Extensions&gt;
85         </xsl:text>
86             </xsl:comment>
87             <xsl:text>&#10;    </xsl:text>
88         </OutOfProcess>
89         <xsl:text>&#10;</xsl:text>
90     </xsl:template>
91
92     <!-- Turn <Local> into <InProcess> with the <ISAPI> element up a level. -->
93     <xsl:template match="oldconf:Local">
94         <xsl:text>&#10;    </xsl:text>
95         <InProcess logger="{@logger}">
96             <xsl:if test="@unsetHeaderValue">
97                 <xsl:attribute name="unsetHeaderValue"><xsl:value-of select="@unsetHeaderValue"/></xsl:attribute>
98             </xsl:if>
99             <xsl:apply-templates select="oldconf:Implementation/oldconf:ISAPI"/>
100             <xsl:text>&#10;    </xsl:text>
101         </InProcess>
102         <xsl:text>&#10;</xsl:text>
103     </xsl:template>
104     <xsl:template match="oldconf:ISAPI">
105         <xsl:text>&#10;        </xsl:text>
106         <ISAPI>
107             <xsl:apply-templates select="@*"/>
108             <xsl:for-each select="oldconf:Site">
109                 <xsl:text>&#10;            </xsl:text>
110                 <Site>
111                     <xsl:apply-templates select="@*"/>
112                     <xsl:for-each select="oldconf:Alias">
113                         <xsl:text>&#10;                </xsl:text>
114                         <Alias><xsl:value-of select="text()"/></Alias>
115                     </xsl:for-each>
116                     <xsl:text>&#10;            </xsl:text>
117                 </Site>
118             </xsl:for-each>
119             <xsl:text>&#10;        </xsl:text>
120         </ISAPI>
121     </xsl:template>
122
123     <!-- Pull in listeners up to the top level. -->
124     <xsl:template match="oldconf:UnixListener">
125         <xsl:text>&#10;    </xsl:text>
126         <UnixListener address="shibd.sock"/>
127         <xsl:text>&#10;</xsl:text>
128     </xsl:template>
129     <xsl:template match="oldconf:TCPListener">
130         <xsl:text>&#10;    </xsl:text>
131         <TCPListener address="{@address}" port="{@port}" acl="{@acl}"/>
132         <xsl:text>&#10;</xsl:text>
133     </xsl:template>
134
135     <!-- Transplant old RequestMap into the new namespace, but just copy all the settings. -->
136     <xsl:template match="oldconf:RequestMapProvider">
137         <xsl:text>&#10;&#10;    </xsl:text>
138         <RequestMapper type="Native">
139             <xsl:text>&#10;</xsl:text>
140             <xsl:apply-templates select="./*">
141                 <xsl:with-param name="indent">8</xsl:with-param>
142             </xsl:apply-templates>
143             <xsl:text>    </xsl:text>
144         </RequestMapper>
145         <xsl:text>&#10;</xsl:text>
146     </xsl:template>
147
148     <xsl:template match="oldconf:Applications">
149         <xsl:text>&#10;    </xsl:text>
150         <ApplicationDefaults id="{@id}" policyId="default" entityID="{@providerId}" homeURL="{@homeURL}" REMOTE_USER="eppn persistent-id targeted-id" signing="false" encryption="false">
151             <xsl:attribute name="timeout"><xsl:value-of select="../oldconf:Global/oldconf:MemorySessionCache/@AATimeout"/></xsl:attribute>
152             <xsl:attribute name="connectTimeout"><xsl:value-of select="../oldconf:Global/oldconf:MemorySessionCache/@AAConnectTimeout"/></xsl:attribute>
153             <xsl:if test="oldconf:CredentialUse/@TLS!=../oldconf:CredentialsProvider/cred:Credentials/cred:FileResolver[1]/@Id">
154                 <xsl:attribute name="keyName"><xsl:value-of select="oldconf:CredentialUse/@TLS"/></xsl:attribute>
155             </xsl:if>
156             <xsl:if test="oldconf:CredentialUse/@signedAssertions">
157                 <xsl:attribute name="requireSignedAssertions"><xsl:value-of select="oldconf:CredentialUse/@signedAssertions"/></xsl:attribute>   
158             </xsl:if>
159             <xsl:text>&#10;</xsl:text>
160             <xsl:apply-templates select="oldconf:Sessions"/>
161             <xsl:apply-templates select="oldconf:Errors"/>
162             <xsl:apply-templates select="oldconf:CredentialUse"/>
163             <xsl:text>&#10;&#10;        </xsl:text>
164             <MetadataProvider type="Chaining">
165                 <xsl:for-each select="oldconf:MetadataProvider|oldconf:FederationProvider">
166                     <xsl:text>&#10;            </xsl:text>
167                     <MetadataProvider type="XML" file="{@uri}"/>
168                 </xsl:for-each>
169                 <xsl:text>&#10;        </xsl:text>
170             </MetadataProvider>
171             <xsl:text>&#10;&#10;        </xsl:text>
172             <xsl:comment>
173                 <xsl:text> Chain the two built-in trust engines together. </xsl:text>
174             </xsl:comment>
175             <xsl:text>&#10;        </xsl:text>
176             <TrustEngine type="Chaining">
177                 <xsl:text>&#10;            </xsl:text>
178                 <TrustEngine type="ExplicitKey"/>
179                 <xsl:text>&#10;            </xsl:text>
180                 <TrustEngine type="PKIX"/>
181                 <xsl:text>&#10;        </xsl:text>
182             </TrustEngine>
183             <xsl:text>&#10;&#10;        </xsl:text>
184             <xsl:comment>
185                 <xsl:text> Map to extract attributes from SAML assertions. </xsl:text>
186             </xsl:comment>
187             <xsl:text>&#10;        </xsl:text>
188             <AttributeExtractor type="XML" path="attribute-map.xml"/>
189             <xsl:text>&#10;&#10;        </xsl:text>
190             <xsl:comment>
191                 <xsl:text> Use a SAML query if no attributes are supplied during SSO. </xsl:text>
192             </xsl:comment>
193             <xsl:text>&#10;        </xsl:text>
194             <AttributeResolver type="Query"/>
195             <xsl:text>&#10;&#10;        </xsl:text>
196             <xsl:comment>
197                 <xsl:text> Default filtering policy for recognized attributes, lets other data pass. </xsl:text>
198             </xsl:comment>
199             <xsl:text>&#10;        </xsl:text>
200             <AttributeFilter type="XML" path="attribute-policy.xml"/>
201             <xsl:text>&#10;&#10;</xsl:text>
202        
203             <!-- Step up and pull in credentials from the top level. -->
204             <xsl:apply-templates select="../oldconf:CredentialsProvider"/>
205        
206             <xsl:for-each select="oldconf:Application">
207                 <xsl:text>&#10;        </xsl:text>
208                 <ApplicationOverride id="{@id}" entityID="{@providerId}" homeURL="{@homeURL}">
209                     <xsl:apply-templates select="oldconf:Sessions"/>
210                     <xsl:apply-templates select="oldconf:Errors"/>
211                     <xsl:apply-templates select="oldconf:CredentialUse"/>
212                     <xsl:if test="count(oldconf:MetadataProvider) + count(oldconf:FederationProvider) > 0">
213                         <xsl:text>&#10;            </xsl:text>
214                         <MetadataProvider type="Chaining">
215                         <xsl:for-each select="oldconf:MetadataProvider|oldconf:FederationProvider">
216                             <xsl:text>&#10;                </xsl:text>
217                             <MetadataProvider type="XML" file="{@uri}"/>
218                         </xsl:for-each>
219                         <xsl:text>&#10;            </xsl:text>
220                         </MetadataProvider>
221                     </xsl:if>
222                     <xsl:text>&#10;&#10;        </xsl:text>
223                 </ApplicationOverride>
224             </xsl:for-each>
225        
226             <xsl:text>&#10;&#10;    </xsl:text>
227         </ApplicationDefaults>
228     </xsl:template>
229     
230     <xsl:template match="oldconf:Sessions">
231         <xsl:text>&#10;        </xsl:text>
232         <Sessions exportLocation="http://localhost/{@handlerURL}/GetAssertion">
233             <xsl:apply-templates select="@*"/>
234             <xsl:text>&#10;&#10;            </xsl:text>
235             <xsl:comment>
236                 <xsl:text>
237             SessionInitiators handle session requests and relay them to a Discovery page,
238             or to an IdP if possible. Automatic session setup will use the default or first
239             element (or requireSessionWith can specify a specific one to use).
240             </xsl:text>
241             </xsl:comment>
242             <xsl:for-each select="oldconf:SessionInitiator">
243                 <xsl:apply-templates select="."/>
244             </xsl:for-each>
245             <xsl:text>&#10;&#10;            </xsl:text>
246             <xsl:comment>
247                 <xsl:text>
248             md:AssertionConsumerService locations handle specific SSO protocol bindings,
249             such as SAML 2.0 POST or SAML 1.1 Artifact. The isDefault and index attributes
250             are used when sessions are initiated to determine how to tell the IdP where and
251             how to return the response.
252             </xsl:text>
253             </xsl:comment>
254             <xsl:text>&#10;            </xsl:text>
255             <md:AssertionConsumerService Location="/SAML2/POST" index="1" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
256             <xsl:text>&#10;            </xsl:text>
257             <md:AssertionConsumerService Location="/SAML2/POST-SimpleSign" index="2" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign"/>
258             <xsl:text>&#10;            </xsl:text>
259             <md:AssertionConsumerService Location="/SAML2/Artifact" index="3" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"/>
260             <xsl:text>&#10;            </xsl:text>
261             <md:AssertionConsumerService Location="/SAML2/ECP" index="4" Binding="urn:oasis:names:tc:SAML:2.0:bindings:PAOS"/>
262             <xsl:text>&#10;            </xsl:text>
263             <md:AssertionConsumerService Location="/SAML/POST" index="5" Binding="urn:oasis:names:tc:SAML:1.0:profiles:browser-post"/>
264             <xsl:text>&#10;            </xsl:text>
265             <md:AssertionConsumerService Location="/SAML/Artifact" index="6" Binding="urn:oasis:names:tc:SAML:1.0:profiles:artifact-01"/>
266             <xsl:text>&#10;&#10;            </xsl:text>
267
268             <!-- Turn the old local SLO location into the new LogoutInitiator location. -->
269             <xsl:variable name="LogoutLocation">
270                 <xsl:choose>
271                     <xsl:when test="md:SingleLogoutService[1]">
272                         <xsl:value-of select="md:SingleLogoutService[1]/@Location"/>
273                     </xsl:when>
274                     <xsl:otherwise>/Logout</xsl:otherwise>
275                 </xsl:choose>
276             </xsl:variable>
277            
278             <xsl:comment>
279             <xsl:text> LogoutInitiators enable SP-initiated local or global/single logout of sessions. </xsl:text>
280             </xsl:comment>
281             <xsl:text>&#10;            </xsl:text>
282             <LogoutInitiator type="Chaining" Location="{$LogoutLocation}" relayState="cookie">
283                 <xsl:text>&#10;                </xsl:text>
284                 <LogoutInitiator type="SAML2" template="bindingTemplate.html"/>
285                 <xsl:text>&#10;                </xsl:text>
286                 <LogoutInitiator type="Local"/>
287                 <xsl:text>&#10;            </xsl:text>
288             </LogoutInitiator>
289             <xsl:text>&#10;&#10;            </xsl:text>
290
291             <xsl:comment>
292             <xsl:text> md:SingleLogoutService locations handle single logout (SLO) protocol messages. </xsl:text>
293             </xsl:comment>
294             <xsl:text>&#10;            </xsl:text>
295             <md:SingleLogoutService Location="/SLO/SOAP" Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
296             <xsl:text>&#10;            </xsl:text>
297             <md:SingleLogoutService Location="/SLO/Redirect" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"/>
298             <xsl:text>&#10;            </xsl:text>
299             <md:SingleLogoutService Location="/SLO/POST" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
300             <xsl:text>&#10;            </xsl:text>
301             <md:SingleLogoutService Location="/SLO/Artifact" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"/>
302             <xsl:text>&#10;&#10;            </xsl:text>
303
304             <xsl:comment>
305             <xsl:text> md:ManageNameIDService locations handle NameID management (NIM) protocol messages. </xsl:text>
306             </xsl:comment>
307             <xsl:text>&#10;            </xsl:text>
308             <md:ManageNameIDService Location="/NIM/SOAP" Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
309             <xsl:text>&#10;            </xsl:text>
310             <md:ManageNameIDService Location="/NIM/Redirect" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"/>
311             <xsl:text>&#10;            </xsl:text>
312             <md:ManageNameIDService Location="/NIM/POST" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
313             <xsl:text>&#10;            </xsl:text>
314             <md:ManageNameIDService Location="/NIM/Artifact" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"/>
315             <xsl:text>&#10;&#10;            </xsl:text>
316
317             <xsl:comment>
318             <xsl:text>
319             md:ArtifactResolutionService locations resolve artifacts issued when using the
320             SAML 2.0 HTTP-Artifact binding on outgoing messages, generally uses SOAP.
321             </xsl:text>
322             </xsl:comment>
323             <xsl:text>&#10;            </xsl:text>
324             <md:ArtifactResolutionService Location="/Artifact/SOAP" index="1" Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
325             <xsl:text>&#10;&#10;            </xsl:text>
326
327             <xsl:comment>
328             <xsl:text> Extension service that generates "approximate" metadata based on SP configuration. </xsl:text>
329             </xsl:comment>
330             <xsl:text>&#10;            </xsl:text>
331             <Handler type="MetadataGenerator" Location="/Metadata" signing="false"/>
332             <xsl:text>&#10;&#10;            </xsl:text>
333            
334             <xsl:comment>
335             <xsl:text> Status reporting service. </xsl:text>
336             </xsl:comment>
337             <xsl:text>&#10;            </xsl:text>
338             <Handler type="Status" Location="Status" acl="127.0.0.1"/>
339             <xsl:text>&#10;&#10;            </xsl:text>
340
341             <xsl:comment>
342             <xsl:text> Session diagnostic service. </xsl:text>
343             </xsl:comment>
344             <xsl:text>&#10;            </xsl:text>
345             <Handler type="Session" Location="/Session"/>
346             <xsl:text>&#10;        </xsl:text>
347         </Sessions>
348         <xsl:text>&#10;</xsl:text>
349     </xsl:template>
350     
351     <xsl:template match="oldconf:SessionInitiator">
352         <xsl:text>&#10;&#10;            </xsl:text>
353         <SessionInitiator type="Chaining" Location="{@Location}" acsByIndex="false" relayState="cookie">
354             <xsl:if test="@id">
355                 <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
356             </xsl:if>
357             <xsl:if test="@isDefault">
358                 <xsl:attribute name="isDefault"><xsl:value-of select="@isDefault"/></xsl:attribute>
359             </xsl:if>
360             <xsl:if test="@Location=../oldconf:SessionInitiator[1]/@Location">
361                 <xsl:if test="$idp">
362                     <xsl:attribute name="entityID"><xsl:value-of select="$idp"/></xsl:attribute>
363                 </xsl:if>
364             </xsl:if>
365             <xsl:text>&#10;                </xsl:text>
366             <SessionInitiator type="SAML2" acsIndex="1" ECP="true" template="bindingTemplate.html"/>
367             <xsl:text>&#10;                </xsl:text>
368             <SessionInitiator type="Shib1" acsIndex="5"/>
369             <xsl:if test="@wayfURL">
370                 <xsl:if test="@wayfBinding='urn:mace:shibboleth:1.0:profiles:AuthnRequest'">
371                     <xsl:text>&#10;                </xsl:text>
372                     <SessionInitiator type="WAYF" URL="{@wayfURL}"/>
373                 </xsl:if>
374             </xsl:if>
375             <xsl:text>&#10;            </xsl:text>
376         </SessionInitiator>
377     </xsl:template>
378     
379     <!-- Map <Errors> element across, adding logout templates. -->
380     <xsl:template match="oldconf:Errors">
381         <xsl:text>&#10;        </xsl:text>
382         <Errors>
383             <xsl:apply-templates select="@*"/>
384             <xsl:text>&#10;        </xsl:text>
385         </Errors>
386         <xsl:text>&#10;</xsl:text>
387     </xsl:template>
388     
389     <!-- Map <CredentialUse> element content into relying party overrides. -->
390     <xsl:template match="oldconf:CredentialUse">
391         <xsl:for-each select="oldconf:RelyingParty">
392             <xsl:if test="@TLS">
393                 <xsl:text>&#10;        </xsl:text>
394                 <RelyingParty Name="{@Name}" keyName="{@TLS}"/>
395             </xsl:if>
396         </xsl:for-each>
397     </xsl:template>
398
399     <!-- Map legacy <FileResolver> elements to CredentialResolver plugins. -->
400     <xsl:template match="oldconf:CredentialsProvider">
401         <xsl:choose>
402             <xsl:when test="count(//cred:FileResolver) > 1">
403                 <xsl:text>        </xsl:text>
404                 <CredentialResolver type="Chaining">
405                     <xsl:text>&#10;</xsl:text>
406                     <xsl:apply-templates select="//cred:FileResolver">
407                         <xsl:with-param name="indent">12</xsl:with-param>
408                     </xsl:apply-templates>
409                     <xsl:text>        </xsl:text>
410                 </CredentialResolver>
411                 <xsl:text>&#10;</xsl:text>
412             </xsl:when>
413             <xsl:otherwise>
414                 <xsl:apply-templates select="//cred:FileResolver">
415                     <xsl:with-param name="indent">8</xsl:with-param>
416                 </xsl:apply-templates>
417             </xsl:otherwise>
418         </xsl:choose>
419     </xsl:template>
420     <xsl:template match="cred:FileResolver">
421         <xsl:param name="indent"/>
422         <xsl:value-of select="substring($spaces,0,$indent+1)"/>
423         <CredentialResolver type="File" key="{cred:Key/cred:Path/text()}" certificate="{cred:Certificate/cred:Path/text()}" keyName="{@Id}"/>
424         <xsl:text>&#10;</xsl:text>
425     </xsl:template>
426
427     <!-- Generic rule to pass through all element node content while converting the namespace. -->
428     <xsl:template match="oldconf:RequestMap|oldconf:Host|oldconf:HostRegex|oldconf:Path|oldconf:PathRegex|oldconf:htaccess|oldconf:AccessControl|oldconf:AND|oldconf:OR|oldconf:NOT">
429         <xsl:param name="indent"/>
430         <xsl:value-of select="substring($spaces,0,$indent+1)"/>
431         <xsl:element name="{name()}">
432             <xsl:apply-templates select="@*"/>
433             <xsl:text>&#10;</xsl:text>
434             <xsl:apply-templates select="./*">
435                 <xsl:with-param name="indent" select="$indent + 4"/>
436             </xsl:apply-templates>
437             <xsl:value-of select="substring($spaces,0,$indent+1)"/>
438         </xsl:element>
439         <xsl:text>&#10;</xsl:text>
440     </xsl:template>
441
442     <!-- Generic rule to pass through all attributes plus text content while converting the namespace. -->
443     <xsl:template match="oldconf:Rule">
444         <xsl:param name="indent"/>
445         <xsl:value-of select="substring($spaces,0,$indent+1)"/>
446         <xsl:element name="{name()}">
447             <xsl:apply-templates select="@*"/>
448             <xsl:value-of select="text()"/>
449         </xsl:element>
450         <xsl:text>&#10;</xsl:text>
451     </xsl:template>
452
453     <!-- Generic rule to pass through an attribute unmodified. -->
454     <xsl:template match="@*">
455         <xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
456     </xsl:template>
457
458     <!-- Strips additional text nodes out of document. -->
459     <xsl:template match="text()"/>
460
461 </xsl:stylesheet>