--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+ xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
+ xmlns:oldconf="urn:mace:shibboleth:target:config:1.0"
+ xmlns:cred="urn:mace:shibboleth:credentials:1.0"
+ xmlns="urn:mace:shibboleth:2.0:native:sp:config"
+ xmlns:saml1="urn:oasis:names:tc:SAML:1.0:assertion"
+ xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
+ xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
+ exclude-result-prefixes="oldconf cred saml1">
+
+ <!-- Add a comment to the start of the output file. -->
+ <xsl:template match="/">
+ <xsl:comment>
+ <xsl:text> Generated by upgrade utility: check carefully before deploying. </xsl:text>
+ </xsl:comment>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <!--Force UTF-8 encoding for the output.-->
+ <xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/>
+
+ <xsl:template match="oldconf:SPConfig">
+ <SPConfig logger="{@logger}" clockSkew="{@clockSkew}">
+ <xsl:text> </xsl:text>
+ <xsl:apply-templates select="oldconf:Global"/>
+ <xsl:text> </xsl:text>
+ <xsl:apply-templates select="oldconf:Local"/>
+ <xsl:text> </xsl:text>
+ <xsl:apply-templates select="oldconf:Global/oldconf:UnixListener"/>
+ <xsl:apply-templates select="oldconf:Global/oldconf:TCPListener"/>
+ <xsl:text> </xsl:text>
+  <xsl:comment>
+ <xsl:text> This set of components stores sessions and other persistent data in daemon memory. </xsl:text>
+ </xsl:comment>
+  <StorageService type="Memory" id="mem" cleanupInterval="900"/>
+  <SessionCache type="StorageService" StorageService="mem" cacheTimeout="{oldconf:Global/oldconf:MemorySessionCache/@cacheTimeout}" inprocTimeout="900" cleanupInterval="900"/>
+  <ReplayCache StorageService="mem"/>
+  <ArtifactMap artifactTTL="180"/>
+ <xsl:text> </xsl:text>
+  <xsl:comment>
+ <xsl:text> This set of components stores sessions and other persistent data in an ODBC database. </xsl:text>
+ </xsl:comment>
+  <xsl:comment>
+ <xsl:text>
+  <StorageService type="ODBC" id="db" cleanupInterval="900">
+  <ConnectionString>DRIVER=drivername;SERVER=dbserver;UID=shibboleth;PWD=password;DATABASE=shibboleth;APP=Shibboleth</ConnectionString>
+  </StorageService>
+  <SessionCache type="StorageService" StorageService="db" cacheTimeout="3600" inprocTimeout="900" cleanupInterval="900"/>
+  <ReplayCache StorageService="db"/>
+  <ArtifactMap StorageService="db" artifactTTL="180"/>
+ </xsl:text>
+ </xsl:comment>
+ <xsl:text> </xsl:text>
+ <xsl:apply-templates select="oldconf:Local/oldconf:RequestMapProvider"/>
+ <xsl:text> </xsl:text>
+ <xsl:apply-templates select="oldconf:Applications"/>
+ </SPConfig>
+ </xsl:template>
+
+ <!-- Turn <Global> into <OutOfProcess> with the ODBC extension commented out. -->
+ <xsl:template match="oldconf:Global">
+  <OutOfProcess logger="{@logger}">
+  <xsl:comment>
+ <xsl:text>
+  <Extensions>
+  <Library path="odbc-store.so" fatal="true"/>
+ </Extensions>
+ </xsl:text>
+ </xsl:comment>
+  </OutOfProcess>
+ </xsl:template>
+
+ <xsl:template match="oldconf:Local">
+  <InProcess logger="{@logger}">
+
+  </InProcess>
+ </xsl:template>
+
+ <xsl:template match="oldconf:Global/oldconf:UnixListener">
+  <UnixListener address="shibd.sock"/>
+ </xsl:template>
+
+ <xsl:template match="oldconf:Global/oldconf:TCPListener">
+  <TCPListener address="{@address}" port="{@port}" acl="{@acl}"/>
+ </xsl:template>
+
+ <!-- Transplant old RequestMap into the new namespace, but just copy all the settings. -->
+ <xsl:template match="oldconf:RequestMapProvider">
+  <RequestMapper type="Native">
+ <xsl:apply-templates select="oldconf:RequestMap"/>
+  </RequestMapper>
+ </xsl:template>
+ <xsl:template match="oldconf:RequestMap">
+  <RequestMap>
+ <xsl:apply-templates select="@*"/>
+ <xsl:for-each select="oldconf:Host">
+  <Host>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates select="oldconf:Path"/>
+  </Host>
+ </xsl:for-each>
+  </RequestMap>
+ </xsl:template>
+ <xsl:template match="oldconf:Path">
+  <Path>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates select="oldconf:Path"/>
+  </Path>
+ </xsl:template>
+
+ <xsl:template match="oldconf:Applications">
+  <ApplicationDefaults>
+ <!-- Step up and pull in credentials from the top level. -->
+ <xsl:apply-templates select="../oldconf:CredentialsProvider"/>
+  </ApplicationDefaults>
+ </xsl:template>
+
+ <!-- Map legacy <FileResolver> elements to CredentialResolver plugins. -->
+ <xsl:template match="oldconf:CredentialsProvider">
+ <xsl:apply-templates select="//cred:FileResolver"/>
+ </xsl:template>
+ <xsl:template match="cred:FileResolver">
+  <CredentialResolver type="File" key="{cred:Key/cred:Path/text()}" certificate="{cred:Certificate/cred:Path/text()}" keyName="{@Id}"/>
+ </xsl:template>
+
+ <xsl:template match="@*">
+ <xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+
+ <xsl:template match="text()"/>
+
+</xsl:stylesheet>