From ad200d0e2f44bd579cccad388140287a92ef6dea Mon Sep 17 00:00:00 2001 From: Martin Goik <goik@hdm-stuttgart.de> Date: Wed, 31 May 2017 14:40:31 +0200 Subject: [PATCH] Common qandase generating template --- ws/Docbook/Preprocess/Xsl/common.xsl | 57 +++++++++++-------- ws/Docbook/Preprocess/Xsl/docbook2docbook.xsl | 13 ----- 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/ws/Docbook/Preprocess/Xsl/common.xsl b/ws/Docbook/Preprocess/Xsl/common.xsl index df264c261..65a0a5047 100644 --- a/ws/Docbook/Preprocess/Xsl/common.xsl +++ b/ws/Docbook/Preprocess/Xsl/common.xsl @@ -1,26 +1,37 @@ <?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 diff --git a/ws/Docbook/Preprocess/Xsl/docbook2docbook.xsl b/ws/Docbook/Preprocess/Xsl/docbook2docbook.xsl index ea6c3c7d0..3fcfb0ca6 100644 --- a/ws/Docbook/Preprocess/Xsl/docbook2docbook.xsl +++ b/ws/Docbook/Preprocess/Xsl/docbook2docbook.xsl @@ -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))]"> -- GitLab