TEI to XHTML in XSLT 1
Posted: Wed May 28, 2014 6:47 pm
I am fairly new to writing XSLT. I have a basic XSLT2 stylesheet for transforming TEI into XHTML. However, it cannot be used by most web browsers, and I don't seem to be able to turn it into functioning XSLT1. The original XSLT2 is
Can anyone help me out?
Thanks,
Gareth.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xpath-default-namespace="http://www.tei-c.org/ns/1.0" version="2.0">
<xsl:template match="TEI">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>
<xsl:value-of select="teiHeader/fileDesc/titleStmt/title"/>
</title>
</head>
<body>
<xsl:apply-templates select="text/front"/>
<xsl:apply-templates select="text/body"/>
</body>
</html>
</xsl:template>
<xsl:template match="front">
<h1>
<xsl:value-of select="titlePage/docTitle/titlePart[@type='main']"/>
</h1>
<h2>
<xsl:value-of select="titlePage/docTitle/titlePart[@type='sub']"/>
</h2>
<h3><xsl:value-of select="titlePage/byline/docAuthor"/>, <xsl:value-of
select="titlePage/docImprint/pubPlace"/></h3>
</xsl:template>
<xsl:template match="body">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="p">
<p>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="foreign">
<em>
<xsl:apply-templates/>
</em>
</xsl:template>
<xsl:template match="q|soCalled"> ‘<xsl:apply-templates/>’ </xsl:template>
<xsl:template match="placeName">
<u>
<xsl:apply-templates/>
</u>
</xsl:template>
<xsl:template match="persName">
<strong>
<xsl:apply-templates/>
</strong>
</xsl:template>
</xsl:stylesheet>
Thanks,
Gareth.