Change2change.xslt

The P5 element is significantly different than the P4 element. This stylesheet reads in a TEI P4 XML file and writes out the same file but with P5-format elements. 







            <xsl:attribute name="who"> <xsl:if test="count(./respStmt/name)>1"> <xsl:message> warning: more than one &amp;lt;name> child of &amp;lt;respStmt>, using the first </xsl:message> </xsl:if> <xsl:variable name="respName">  <xsl:when test="./respStmt/name/@key"> <xsl:value-of select="./respStmt/name/@key"/> </xsl:when> <xsl:when test="./respStmt/name/@reg"> <xsl:value-of select="./respStmt/name/@reg"/> </xsl:when>  <xsl:value-of select="./respStmt/name/text"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="respVal" select='translate(normalize-space($respName),"-,&apos;&amp;amp;#$%^!~`={}[]&amp;lt;&amp;gt;?/:; +=\|@","-")'/> <xsl:text>#</xsl:text> <xsl:value-of select="$respVal"/> </xsl:attribute> <xsl:apply-templates select="./item/*|./item/text|./item/processing-instruction|./item/comment"/> </xsl:element> </xsl:template>

</xsl:stylesheet>

Syd 06:51, 26 May 2006 (BST)