diff options
Diffstat (limited to 'xslt/docbook/common/db-common.xsl')
-rw-r--r-- | xslt/docbook/common/db-common.xsl | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/xslt/docbook/common/db-common.xsl b/xslt/docbook/common/db-common.xsl index 51f3f18..3897794 100644 --- a/xslt/docbook/common/db-common.xsl +++ b/xslt/docbook/common/db-common.xsl @@ -87,7 +87,36 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA <xsl:template name="db.linenumbering"> <xsl:param name="node" select="."/> <xsl:param name="number" select="1"/> - <xsl:variable name="substr" select="string($node)"/> + <xsl:variable name="substr"> + <xsl:choose> + <xsl:when test="node()[1]/self::text()"> + <xsl:choose> + <!-- CR LF --> + <xsl:when test="starts-with(string($node), '
')"> + <xsl:value-of select="substring-after(string($node), '
')"/> + </xsl:when> + <!-- CR --> + <xsl:when test="starts-with(string($node), '
')"> + <xsl:value-of select="substring-after(string($node), '
')"/> + </xsl:when> + <!-- LF --> + <xsl:when test="starts-with(string($node), '
')"> + <xsl:value-of select="substring-after(string($node), '
')"/> + </xsl:when> + <!-- NEL --> + <xsl:when test="starts-with(string($node), '…')"> + <xsl:value-of select="substring-after(string($node), '…')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="string($node)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="string($node)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> <xsl:call-template name="db.linenumbering.substr"> <xsl:with-param name="substr" select="$substr"/> <xsl:with-param name="number" select="$number"/> |