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

Added first draft od opera2html transformation

parent 17c99047
Branches
No related merge requests found
<?xml version="1.0" encoding="utf-8" ?>
<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="html" />
<xsl:template match="/">
<html>
<xsl:apply-templates />
</html>
</xsl:template>
<xsl:template match="tei:teiHeader">
<head>
<xsl:apply-templates select=".//tei:titleStmt" />
<link href="http://fonts.googleapis.com/css?family=IM+Fell+DW+Pica+SC|Lustria" rel="stylesheet" type="text/css" />
<link href="styles/opera.css" rel="stylesheet" type="text/css" />
</head>
</xsl:template>
<xsl:template match="tei:title">
<title><xsl:apply-templates /></title>
</xsl:template>
<xsl:template match="tei:author">
<meta name="author" content="{.}" />
</xsl:template>
<xsl:template match="tei:text">
<body>
<h1><xsl:value-of select="//tei:titleStmt/tei:title" /></h1>
<xsl:apply-templates />
</body>
</xsl:template>
<xsl:template match="tei:front">
<div id="front-matter">
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="tei:castList">
<div class="cast-list">
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="tei:castGroup">
<div class="cast-group">
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="tei:castItem">
<div class="cast-item" id="{@xml:id}"><xsl:apply-templates /></div>
</xsl:template>
<xsl:template match="tei:castList/tei:head">
<h2><xsl:apply-templates /></h2>
</xsl:template>
<xsl:template match="tei:castGroup/tei:head">
<h3><xsl:apply-templates /></h3>
</xsl:template>
<xsl:template match="tei:body">
<div id="body">
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="tei:div[@type='scene']">
<div class="scene" id="scene{@n}">
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="tei:div[@type='scene']/tei:head">
<h2><xsl:apply-templates /></h2>
</xsl:template>
<xsl:template match="musicalPrelude">
<div class="musical-prelude">
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="musicalInterlude">
<div class="musical-interlude">
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="tei:musicalPrelude/tei:head">
<h3><xsl:apply-templates /></h3>
</xsl:template>
<xsl:template match="tei:list">
<ul>
<xsl:apply-templates />
</ul>
</xsl:template>
<xsl:template match="tei:item">
<li><xsl:apply-templates /></li>
</xsl:template>
<xsl:template match="tei:item/tei:stage">
<span class="stage"><xsl:apply-templates /></span>
</xsl:template>
<xsl:template match="tei:stage[not(ancestor::tei:item)]">
<div class="stage">
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="tei:sg">
<div class="sg" id="{@xml:id}">
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="tei:singer">
<span class="singer"><xsl:apply-templates />: </span>
</xsl:template>
<xsl:template match="tei:lyric">
<div class="lyric" id="{ancestor::tei:sg/@xml:id}_{@n}">
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="tei:linkGrp">
<div class="links">
<xsl:apply-templates />
</div>
</xsl:template>
<xsl:template match="tei:ptr[ancestor::tei:linkGrp[@type='audio-cues']]">
<span class="audio-cue"><a href="{@target}"><xsl:value-of select="@cRef" /></a></span>
</xsl:template>
<xsl:template match="tei:ptr[@type='score-location']">
<span class="page-break"><span class="score-location"><xsl:value-of select="@cRef" /></span></span>
</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