Skip to content
Snippets Groups Projects
Commit ad200d0e authored by Goik Martin's avatar Goik Martin
Browse files

Common qandase generating template

parent 564e04e1
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">
<xsl:template name="hdm.get.leftmost.of.separator">
<xsl:param name="path"/>
<xsl:param name="separator"/>
<xsl:param name="start">1</xsl:param>
<xsl:if test="contains($path, $separator )">
<xsl:if test="$start='0'">
<xsl:value-of select="$separator"/>
</xsl:if>
<xsl:value-of select="substring-before($path, $separator)"/>
<xsl:call-template name="hdm.get.leftmost.of.separator">
<xsl:with-param name="path" select="substring-after($path, $separator)"/>
<xsl:with-param name="separator" select="$separator"/>
<xsl:with-param name="start">0</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://docbook.org/ns/docbook" xmlns:db="http://docbook.org/ns/docbook"
exclude-result-prefixes="xs"
version="2.0">
<xsl:template name="hdm.get.leftmost.of.separator">
<xsl:param name="path"/>
<xsl:param name="separator"/>
<xsl:param name="start">1</xsl:param>
<xsl:if test="contains($path, $separator )">
<xsl:if test="$start='0'">
<xsl:value-of select="$separator"/>
</xsl:if>
<xsl:value-of select="substring-before($path, $separator)"/>
<xsl:call-template name="hdm.get.leftmost.of.separator">
<xsl:with-param name="path" select="substring-after($path, $separator)"/>
<xsl:with-param name="separator" select="$separator"/>
<xsl:with-param name="start">0</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="db:qandaset" mode="selectOwnOrInheritedTitle">
<link linkend="{@xml:id}"> <!-- xrefstyle="template:%n, %t" -->
<xsl:choose>
<xsl:when test="db:title">
<xsl:copy-of select="db:title/node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="preceding-sibling::db:title[1]/node()"/>
</xsl:otherwise>
</xsl:choose>
</link>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
......@@ -102,19 +102,6 @@
</section>
</xsl:template>
<xsl:template match="db:qandaset" mode="selectOwnOrInheritedTitle">
<link linkend="{@xml:id}"> <!-- xrefstyle="template:%n, %t" -->
<xsl:choose>
<xsl:when test="db:title">
<xsl:copy-of select="db:title/node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="preceding-sibling::db:title[1]/node()"/>
</xsl:otherwise>
</xsl:choose>
</link>
</xsl:template>
<!-- Excluding non-referenced <bibliography> and <glossary> elements -->
<xsl:template match="db:bibliography/db:biblioentry[not(key('internRef', @xml:id))]">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment