diff --git a/templates/opera2drama.xslt b/templates/opera2drama.xslt new file mode 100644 index 0000000000000000000000000000000000000000..6f5198bf6ffd4d66e582f4555512bc32d1b73060 --- /dev/null +++ b/templates/opera2drama.xslt @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!-- + This transformation converts TEI opera documents into standard TEI + drama documents. It's useful just in order to take advantage of + existing XSLTs for converting TEI drama to HTML. + --> +<xsl:transform + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:tei="http://www.tei-c.org/ns/1.0" + version="1.0"> + +<xsl:output method="xml" /> + +<xsl:template match="/"> + <xsl:apply-templates /> +</xsl:template> + +<xsl:template match="musicalPrelude"> + <xsl:apply-templates /> +</xsl:template> + +<xsl:template match="tei:sg"> + <xsl:element name="sp"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute> + </xsl:for-each> + <xsl:apply-templates /> + </xsl:element> +</xsl:template> + +<xsl:template match="tei:singer"> + <xsl:element name="speaker"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute> + </xsl:for-each> + <xsl:apply-templates /> + </xsl:element> +</xsl:template> + +<xsl:template match="tei:lyric"> + <xsl:element name="l"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute> + </xsl:for-each> + <xsl:apply-templates /> + </xsl:element> +</xsl:template> + +<xsl:template match="tei:*" priority="-1"> + <xsl:element name="{name()}"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute> + </xsl:for-each> + <xsl:apply-templates /> + </xsl:element> +</xsl:template> + +</xsl:transform>