Skip to content
Snippets Groups Projects
Commit 8aeafc1e authored by Richard Lewis's avatar Richard Lewis
Browse files

Added opera2drama XSLT transformation

parent c894fdcd
No related merge requests found
<?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>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment