Dot-two.xslt

This stylesheet actually does two things: Note that the root element is usually  or , but does not have to be.
 * converts  to  and  to ; and
 * moves all elements from no namespace to the TEI namespace.

This stylesheet takes a single optional parameter 'version', which is what will be used as the value of the version= attribute of  or . There is no default. If the parameter is not specified, no version= attribute is output. 







    </xsl:element> </xsl:template>

<xsl:template match="@*|text|comment|processing-instruction"> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </xsl:template>

<xsl:template match="/*"> <xsl:variable name="newName"> <xsl:choose> <xsl:when test="local-name(.)='TEI.2' or local-name='teiCorpus.2'"> <xsl:value-of select="substring-before(local-name(.),'.2')"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="local-name(.)"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:element name="{$newName}" namespace="http://www.tei-c.org/ns/1.0"> <xsl:copy-of select="attribute::*"/> <xsl:if test="local-name='TEI.2' or local-name='teiCorpus.2'"> <xsl:if test="not($version='')"> <xsl:attribute name="version"> <xsl:value-of select="$version"/> </xsl:attribute> </xsl:if> </xsl:if> <xsl:apply-templates select="./*|./text|./processing-instruction|./comment"/> </xsl:element> </xsl:template>

<xsl:template match="/teiCorpus.2/TEI.2"> <xsl:element name="TEI" namespace="http://www.tei-c.org/ns/1.0"> <!-- copy over all my attributes