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