Skip to content

Instantly share code, notes, and snippets.

@jonbitgood
Created August 1, 2019 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonbitgood/d3eac3aa9dc25a1413cebf1c437b93ec to your computer and use it in GitHub Desktop.
Save jonbitgood/d3eac3aa9dc25a1413cebf1c437b93ec to your computer and use it in GitHub Desktop.
XSLT for USX 3.0
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" />
<xsl:strip-space elements="*" />
<xsl:template match="usx">
<html>
<head>
<meta content="utf-8" />
<link rel="stylesheet" href="bible.css" />
</head>
<body>
<main><xsl:apply-templates /></main>
</body>
</html>
</xsl:template>
<xsl:template match="para[@style='rem']|para[@style='ide']|verse[@eid]"></xsl:template>
<xsl:template match="para">
<p><xsl:apply-templates select="@*|node()" /></p>
</xsl:template>
<xsl:template match="char">
<em><xsl:apply-templates select="@*|node()" /></em>
</xsl:template>
<xsl:template match="note">
<span class="note"><xsl:apply-templates select="@*|node()" /></span>
</xsl:template>
<xsl:template match="chapter">
<b class="c"><xsl:value-of select="@number" /></b>
</xsl:template>
<xsl:template match="verse[@sid]">
<sup class="verse"><xsl:value-of select="@number" /></sup>
</xsl:template>
<xsl:template match="book">
<div>
<xsl:attribute name="id">
<xsl:value-of select="@code" />
</xsl:attribute>
</div>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy><xsl:apply-templates select="@*|node()" /></xsl:copy>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment