20a105392f112cd2522837999f93eee11cd767e5
[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 id="{@id}" entityID="{@providerId}" homeURL="{@homeURL}">
227                     <xsl:apply-templates select="oldconf:Sessions"/>
228                     <xsl:apply-templates select="oldconf:Errors"/>
229                     <xsl:apply-templates select="oldconf:CredentialUse"/>
230                     <xsl:if test="count(oldconf:MetadataProvider) + count(oldconf:FederationProvider) > 0">
231                         <xsl:text>&#10;            </xsl:text>
232                         <MetadataProvider type="Chaining">
233                         <xsl:for-each select="oldconf:MetadataProvider|oldconf:FederationProvider">
234                             <xsl:text>&#10;                </xsl:text>
235                             <MetadataProvider type="XML" file="{@uri}"/>
236                         </xsl:for-each>
237                         <xsl:text>&#10;            </xsl:text>
238                         </MetadataProvider>
239                     </xsl:if>
240                     <xsl:text>&#10;&#10;        </xsl:text>
241                 </ApplicationOverride>
242             </xsl:for-each>
243        
244             <xsl:text>&#10;&#10;    </xsl:text>
245         </ApplicationDefaults>
246     </xsl:template>
247     
248     <xsl:template match="oldconf:Sessions">
249         <xsl:text>&#10;        </xsl:text>
250         <Sessions exportLocation="http://localhost/{@handlerURL}/GetAssertion">
251             <xsl:apply-templates select="@*"/>
252             <xsl:text>&#10;&#10;            </xsl:text>
253             <xsl:comment>
254                 <xsl:text>
255             SessionInitiators handle session requests and relay them to a Discovery page,
256             or to an IdP if possible. Automatic session setup will use the default or first
257             element (or requireSessionWith can specify a specific one to use).
258             </xsl:text>
259             </xsl:comment>
260             <xsl:for-each select="oldconf:SessionInitiator">
261                 <xsl:apply-templates select="."/>
262             </xsl:for-each>
263             <xsl:text>&#10;&#10;            </xsl:text>
264             <xsl:comment>
265                 <xsl:text>
266             md:AssertionConsumerService locations handle specific SSO protocol bindings,
267             such as SAML 2.0 POST or SAML 1.1 Artifact. The isDefault and index attributes
268             are used when sessions are initiated to determine how to tell the IdP where and
269             how to return the response.
270             </xsl:text>
271             </xsl:comment>
272             <xsl:text>&#10;            </xsl:text>
273             <md:AssertionConsumerService Location="/SAML2/POST" index="1" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
274             <xsl:text>&#10;            </xsl:text>
275             <md:AssertionConsumerService Location="/SAML2/POST-SimpleSign" index="2" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign"/>
276             <xsl:text>&#10;            </xsl:text>
277             <md:AssertionConsumerService Location="/SAML2/Artifact" index="3" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"/>
278             <xsl:text>&#10;            </xsl:text>
279             <md:AssertionConsumerService Location="/SAML2/ECP" index="4" Binding="urn:oasis:names:tc:SAML:2.0:bindings:PAOS"/>
280             <xsl:text>&#10;            </xsl:text>
281             <md:AssertionConsumerService Location="/SAML/POST" index="5" Binding="urn:oasis:names:tc:SAML:1.0:profiles:browser-post"/>
282             <xsl:text>&#10;            </xsl:text>
283             <md:AssertionConsumerService Location="/SAML/Artifact" index="6" Binding="urn:oasis:names:tc:SAML:1.0:profiles:artifact-01"/>
284             <xsl:text>&#10;&#10;            </xsl:text>
285
286             <!-- Turn the old local SLO location into the new LogoutInitiator location. -->
287             <xsl:variable name="LogoutLocation">
288                 <xsl:choose>
289                     <xsl:when test="md:SingleLogoutService[1]">
290                         <xsl:value-of select="md:SingleLogoutService[1]/@Location"/>
291                     </xsl:when>
292                     <xsl:otherwise>/Logout</xsl:otherwise>
293                 </xsl:choose>
294             </xsl:variable>
295            
296             <xsl:comment>
297             <xsl:text> LogoutInitiators enable SP-initiated local or global/single logout of sessions. </xsl:text>
298             </xsl:comment>
299             <xsl:text>&#10;            </xsl:text>
300             <LogoutInitiator type="Chaining" Location="{$LogoutLocation}" relayState="cookie">
301                 <xsl:text>&#10;                </xsl:text>
302                 <LogoutInitiator type="SAML2" template="bindingTemplate.html"/>
303                 <xsl:text>&#10;                </xsl:text>
304                 <LogoutInitiator type="Local"/>
305                 <xsl:text>&#10;            </xsl:text>
306             </LogoutInitiator>
307             <xsl:text>&#10;&#10;            </xsl:text>
308
309             <xsl:comment>
310             <xsl:text> md:SingleLogoutService locations handle single logout (SLO) protocol messages. </xsl:text>
311             </xsl:comment>
312             <xsl:text>&#10;            </xsl:text>
313             <md:SingleLogoutService Location="/SLO/SOAP" Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
314             <xsl:text>&#10;            </xsl:text>
315             <md:SingleLogoutService Location="/SLO/Redirect" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"/>
316             <xsl:text>&#10;            </xsl:text>
317             <md:SingleLogoutService Location="/SLO/POST" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
318             <xsl:text>&#10;            </xsl:text>
319             <md:SingleLogoutService Location="/SLO/Artifact" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"/>
320             <xsl:text>&#10;&#10;            </xsl:text>
321
322             <xsl:comment>
323             <xsl:text> md:ManageNameIDService locations handle NameID management (NIM) protocol messages. </xsl:text>
324             </xsl:comment>
325             <xsl:text>&#10;            </xsl:text>
326             <md:ManageNameIDService Location="/NIM/SOAP" Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
327             <xsl:text>&#10;            </xsl:text>
328             <md:ManageNameIDService Location="/NIM/Redirect" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"/>
329             <xsl:text>&#10;            </xsl:text>
330             <md:ManageNameIDService Location="/NIM/POST" conf:template="bindingTemplate.html" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
331             <xsl:text>&#10;            </xsl:text>
332             <md:ManageNameIDService Location="/NIM/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>
337             md:ArtifactResolutionService locations resolve artifacts issued when using the
338             SAML 2.0 HTTP-Artifact binding on outgoing messages, generally uses SOAP.
339             </xsl:text>
340             </xsl:comment>
341             <xsl:text>&#10;            </xsl:text>
342             <md:ArtifactResolutionService Location="/Artifact/SOAP" index="1" Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"/>
343             <xsl:text>&#10;&#10;            </xsl:text>
344
345             <xsl:comment>
346             <xsl:text> Extension service that generates "approximate" metadata based on SP configuration. </xsl:text>
347             </xsl:comment>
348             <xsl:text>&#10;            </xsl:text>
349             <Handler type="MetadataGenerator" Location="/Metadata" signing="false"/>
350             <xsl:text>&#10;&#10;            </xsl:text>
351            
352             <xsl:comment>
353             <xsl:text> Status reporting service. </xsl:text>
354             </xsl:comment>
355             <xsl:text>&#10;            </xsl:text>
356             <Handler type="Status" Location="Status" acl="127.0.0.1"/>
357             <xsl:text>&#10;&#10;            </xsl:text>
358
359             <xsl:comment>
360             <xsl:text> Session diagnostic service. </xsl:text>
361             </xsl:comment>
362             <xsl:text>&#10;            </xsl:text>
363             <Handler type="Session" Location="/Session"/>
364             <xsl:text>&#10;        </xsl:text>
365         </Sessions>
366         <xsl:text>&#10;</xsl:text>
367     </xsl:template>
368     
369     <xsl:template match="oldconf:SessionInitiator">
370         <xsl:text>&#10;&#10;            </xsl:text>
371         <SessionInitiator type="Chaining" Location="{@Location}" acsByIndex="false" relayState="cookie">
372             <xsl:if test="@id">
373                 <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
374             </xsl:if>
375             <xsl:if test="@isDefault">
376                 <xsl:attribute name="isDefault"><xsl:value-of select="@isDefault"/></xsl:attribute>
377             </xsl:if>
378             <xsl:if test="@Location=../oldconf:SessionInitiator[1]/@Location">
379                 <xsl:if test="$idp">
380                     <xsl:attribute name="entityID"><xsl:value-of select="$idp"/></xsl:attribute>
381                 </xsl:if>
382             </xsl:if>
383             <xsl:text>&#10;                </xsl:text>
384             <SessionInitiator type="SAML2" defaultACSIndex="1" ECP="true" template="bindingTemplate.html"/>
385             <xsl:text>&#10;                </xsl:text>
386             <SessionInitiator type="Shib1" defaultACSIndex="4"/>
387             <xsl:if test="@wayfURL">
388                 <xsl:if test="@wayfBinding='urn:mace:shibboleth:1.0:profiles:AuthnRequest'">
389                     <xsl:text>&#10;                </xsl:text>
390                     <SessionInitiator type="WAYF" URL="{@wayfURL}"/>
391                 </xsl:if>
392             </xsl:if>
393             <xsl:text>&#10;            </xsl:text>
394         </SessionInitiator>
395     </xsl:template>
396     
397     <!-- Map <Errors> element across, adding logout templates. -->
398     <xsl:template match="oldconf:Errors">
399         <xsl:text>&#10;        </xsl:text>
400         <Errors>
401             <xsl:apply-templates select="@*"/>
402             <xsl:attribute name="localLogout">localLogout.html</xsl:attribute>
403             <xsl:attribute name="globalLogout">globalLogout.html</xsl:attribute>
404             <xsl:text>&#10;        </xsl:text>
405         </Errors>
406         <xsl:text>&#10;</xsl:text>
407     </xsl:template>
408     
409     <!-- Map <CredentialUse> element content into relying party overrides. -->
410     <xsl:template match="oldconf:CredentialUse">
411         <xsl:for-each select="oldconf:RelyingParty">
412             <xsl:if test="@TLS">
413                 <xsl:text>&#10;        </xsl:text>
414                 <RelyingParty Name="{@Name}" keyName="{@TLS}"/>
415             </xsl:if>
416         </xsl:for-each>
417     </xsl:template>
418
419     <!-- Map legacy <FileResolver> elements to CredentialResolver plugins. -->
420     <xsl:template match="oldconf:CredentialsProvider">
421         <xsl:choose>
422             <xsl:when test="count(//cred:FileResolver) > 1">
423                 <xsl:text>        </xsl:text>
424                 <CredentialResolver type="Chaining">
425                     <xsl:text>&#10;</xsl:text>
426                     <xsl:apply-templates select="//cred:FileResolver">
427                         <xsl:with-param name="indent">12</xsl:with-param>
428                     </xsl:apply-templates>
429                     <xsl:text>        </xsl:text>
430                 </CredentialResolver>
431                 <xsl:text>&#10;</xsl:text>
432             </xsl:when>
433             <xsl:otherwise>
434                 <xsl:apply-templates select="//cred:FileResolver">
435                     <xsl:with-param name="indent">8</xsl:with-param>
436                 </xsl:apply-templates>
437             </xsl:otherwise>
438         </xsl:choose>
439     </xsl:template>
440     <xsl:template match="cred:FileResolver">
441         <xsl:param name="indent"/>
442         <xsl:value-of select="substring($spaces,0,$indent+1)"/>
443         <CredentialResolver type="File" key="{cred:Key/cred:Path/text()}" certificate="{cred:Certificate/cred:Path/text()}" keyName="{@Id}"/>
444         <xsl:text>&#10;</xsl:text>
445     </xsl:template>
446
447     <!-- Generic rule to pass through all element node content while converting the namespace. -->
448     <xsl:template match="oldconf:RequestMap|oldconf:Host|oldconf:HostRegex|oldconf:Path|oldconf:PathRegex|oldconf:htaccess|oldconf:AccessControl|oldconf:AND|oldconf:OR|oldconf:NOT">
449         <xsl:param name="indent"/>
450         <xsl:value-of select="substring($spaces,0,$indent+1)"/>
451         <xsl:element name="{name()}">
452             <xsl:apply-templates select="@*"/>
453             <xsl:text>&#10;</xsl:text>
454             <xsl:apply-templates select="./*">
455                 <xsl:with-param name="indent" select="$indent + 4"/>
456             </xsl:apply-templates>
457             <xsl:value-of select="substring($spaces,0,$indent+1)"/>
458         </xsl:element>
459         <xsl:text>&#10;</xsl:text>
460     </xsl:template>
461
462     <!-- Generic rule to pass through all attributes plus text content while converting the namespace. -->
463     <xsl:template match="oldconf:Rule">
464         <xsl:param name="indent"/>
465         <xsl:value-of select="substring($spaces,0,$indent+1)"/>
466         <xsl:element name="{name()}">
467             <xsl:apply-templates select="@*"/>
468             <xsl:value-of select="text()"/>
469         </xsl:element>
470         <xsl:text>&#10;</xsl:text>
471     </xsl:template>
472
473     <!-- Generic rule to pass through an attribute unmodified. -->
474     <xsl:template match="@*">
475         <xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
476     </xsl:template>
477
478     <!-- Strips additional text nodes out of document. -->
479     <xsl:template match="text()"/>
480
481 </xsl:stylesheet>