summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-06-28 15:39:54 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-06-28 15:39:54 +0200
commitecac10cca016094dbca74cbad1f15df4e3484da8 (patch)
tree2598c05396a11f7c30af50e6ebbaad5821425870
parent75da2d5f150ffad9f543ebadba9e7a1896bc4947 (diff)
downloadbible-fetch-ecac10cca016094dbca74cbad1f15df4e3484da8.tar.gz
bible-fetch-ecac10cca016094dbca74cbad1f15df4e3484da8.tar.bz2
bible-fetch-ecac10cca016094dbca74cbad1f15df4e3484da8.zip
convert.xsl: Allow multiple tags to be added to a verse
Some verses have blockquotes, which result in multiple tags, copy until the next verse.
-rw-r--r--convert.xsl37
1 files changed, 26 insertions, 11 deletions
diff --git a/convert.xsl b/convert.xsl
index dafae59..731452e 100644
--- a/convert.xsl
+++ b/convert.xsl
@@ -62,28 +62,43 @@
</xsl:choose>
</xsl:template>
-->
- <xsl:template match="p[span/@class='verse']">
+
+ <xsl:template name="copy-until-next-verse">
+ <xsl:apply-templates select="following-sibling::*[1]" mode="copy-until-next-verse" />
+ </xsl:template>
+ <xsl:template name="copy-with-notes">
+ <xsl:apply-templates select="text()|span[@class='fussnote']|em|br" mode="copy-with-notes" />
+ <xsl:call-template name="copy-until-next-verse" />
+ </xsl:template>
+
+ <!-- Dont copy intermediate headers and annotations into verse -->
+ <xsl:template match="div[@class='annotation']|h2" mode="copy-until-next-verse">
+ <xsl:call-template name="copy-until-next-verse"/>
+ </xsl:template>
+
+ <xsl:template match="*" mode="copy-until-next-verse">
+ <xsl:if test="not(span[@class = 'verse']) and not(@class='fussnote')">
+ <xsl:text> </xsl:text>
+ <br art="x-nl" />
+ <xsl:call-template name="copy-with-notes" />
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="p[span/@class='verse']" mode="conv">
<vers>
<xsl:attribute name="vnumber">
<xsl:value-of select="span[@class='verse']"/>
</xsl:attribute>
- <xsl:apply-templates select="text()|span[@class='fussnote']|em|br" mode="copy-with-notes" />
+ <xsl:call-template name="copy-with-notes" />
+
<!--<xsl:apply-templates select="*" mode="error" />-->
</vers>
</xsl:template>
- <xsl:template match="div[@class='annotation']">
- </xsl:template>
-
-
- <xsl:template match="div[@class='markdown']">
- <xsl:apply-templates select="*" />
- </xsl:template>
-
+ <xsl:template match="*" mode="conv"/>
<xsl:template match="/">
<chapter cnumber="{//span[@class='chapter']}">
- <xsl:apply-templates select="//div[@class='markdown']"/>
+ <xsl:apply-templates select="//div[@class='markdown']/*" mode="conv"/>
</chapter>
</xsl:template>