OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] line numbering with xsltproc

You try something like this in a customization layer. It is not extensively tested. It recursively parses the text node in a programlisting based on the line ending character 
, inserts the line number, and recurses to the next line.
<xsl:template match="programlisting/text()">
  <xsl:call-template name="line.numbering">
    <xsl:with-param name="content" select="."/>
    <xsl:with-param name="count" select="1"/>
<xsl:template name="line.numbering">
  <xsl:param name="content" select="."/>
  <xsl:param name="count" select="1"/>
  <xsl:number value="$count" format="01 "/>
    <xsl:when test="contains($content, '&#xA;')">
      <xsl:value-of select="substring-before($content, '&#xA;')"/>
      <xsl:variable name="rest" select="substring-after($content, '&#xA;')"/>
      <xsl:if test="string-length($rest)">
        <xsl:call-template name="line.numbering">
          <xsl:with-param name="content" select="$rest"/>
          <xsl:with-param name="count" select="$count + 1"/>
      <!-- we are done -->
      <xsl:value-of select="$content"/>
Bob Stayton
Sagehill Enterprises
----- Original Message -----
From: Stock, Jan
Sent: Tuesday, November 11, 2008 6:01 AM
Subject: [docbook-apps] line numbering with xsltproc


I am trying to insert line numbering in my PDFs. I read that only Saxon and Xalan provide that function. Does anyone know how to implement line numbering in DocBook XML files which are parsed with xsltproc?

I would be pleased to receive any help concerning that problem. My extensive online search resulted in no solution.



Harman Becker Automotive Systems GmbH
Management Board: Dr. Klaus Blickle (Chairman), Dr. Udo Hüls, Michael Mauser, Regis Baudot
Chairman of the Supervisory Board: Ansgar Rempp | Domicile: Karlsbad |
Local Court Mannheim: Register No. 361395
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the contents in this e-mail is strictly forbidden.

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]