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