I assumed you meant you wanted to number the lines in a programlisting, which has line break characters that are preserved during processing. That's the kind of line numbering that the Xalan and Saxon extensions do, as well as the XSLT code that I suggested.
Your mail suggests you want to number lines of flowing paragraphs. That isn't something that can be done at the XSLT stage because line breaks are not yet established. It can only be done when the XSL-FO processor lays out the text and decides where to break lines. So you need an XSL-FO processor with an extension that can number lines of typeset material. As far as I know, only the Antenna House XSL Formatter (full version, not Lite) can add line numbering for paragraphs. Bob Stayton Sagehill Enterprises [EMAIL PROTECTED] ----- Original Message ----- From: Stock, Jan To: Bob Stayton Cc: [email protected] Sent: Thursday, November 13, 2008 2:25 AM Subject: AW: [docbook-apps] line numbering with xsltproc Hello Bob, thank you so much for that great template and the immediate reply! It works. But there is still a problem and I can't find a solution: Your choose condition searches the "break" with the "
" entity. But in my case I often don't have any brakes and the result looks like this (blocks are numbered): 01 kldsjf lkdsjf kldsj fkldjslkf jdslkjf lkdsjf ljdslk fjdlsk jflksdj flksdjlkf jlkdsjf lkdsjl kfjdslkjf lkdsj lkfjdslkf jlkdsjf lkdsjlfk dslkf j Kfkldsjflk jdsf lkdsj klfdsjlkf jdlksj flkdsj lkdjs klfjdslk jflkdsj flkdjslfk jdslkj lkdsj lkdsj flkjdsjf lkdsj lkfdsj lkfjdslkjf lkdsj dlskj f Lkjfslkdjflkdsj lkdsjf lkdsj flkdsj lkfdsj klfdjslk fjdlskjf lkdsj lkdjs fj 02 kdsfklsdjflkjdslkfj ldsjf lkdsj lkfdsjlk fjdslkj flkdsjlk fjdslkjf lkdsj lkdsj fkljdslkfj lkdsjf lkjdslkf jlkdsj lkdsjf 03 ksjfdklsj lksdjf kldsjf lkdsjkfl jdslk fjlkdsj flkdsj lkfdjslkf dklsf jlkdsjf lkdsjlkf jdlksjf lkdsjlf kdjslfk jdlksfj lkdsjf lkdsjlkf djslk jlds Skdf lkjdsf jkdnskjf ndsjkf jkdsf jkdsnjf ndsjkf dskjnkjfdsnkjsn So here is my question: Could you explain me in which template the line breaks are set in Docbook? Or do you know an other solution for this specific problem? Thank you very much for that great support! Regards, Jan ------------------------------------------------------------------------------ Von: Bob Stayton [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 11. November 2008 18:44 An: Stock, Jan; [email protected] Betreff: 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:call-template> </xsl:template> <xsl:template name="line.numbering"> <xsl:param name="content" select="."/> <xsl:param name="count" select="1"/> <xsl:number value="$count" format="01 "/> <xsl:choose> <xsl:when test="contains($content, '
')"> <xsl:value-of select="substring-before($content, '
')"/> <xsl:text>
</xsl:text> <xsl:variable name="rest" select="substring-after($content, '
')"/> <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"/> </xsl:call-template> </xsl:if> </xsl:when> <xsl:otherwise> <!-- we are done --> <xsl:value-of select="$content"/> </xsl:otherwise> </xsl:choose> </xsl:template> Bob Stayton Sagehill Enterprises [EMAIL PROTECTED] ----- Original Message ----- From: Stock, Jan To: [email protected] Sent: Tuesday, November 11, 2008 6:01 AM Subject: [docbook-apps] line numbering with xsltproc Hello, 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. Regards, Jan ******************************************* 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. *******************************************
