This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Re: Line Numbering not working in <programlisting> tag.
- To: Michel Goossens <Michel dot Goossens at cern dot ch>,DocBook <docbook at lists dot oasis-open dot org>
- Subject: Re: DOCBOOK: Line Numbering not working in <programlisting> tag.
- From: Jonathan Marks <jm at cmex dot org>
- Date: Thu, 06 Sep 2001 00:07:03 -0700
- List-Id: <docbook.lists.oasis-open.org>
- Organization: CMEX.org
- References: <Pine.LNX.4.21.0109051136430.2657-100000@pcasddoc.cern.ch>
Hey Michel,
Thanks for your efforts. I speak dsssl. I've found a way to make this
work with dsssl - well sort of. The solution forces line numbering,
irrespective of the attribute in the <programlisting> tag.
Add the following to the ldp.dsl file, at the start of both the print
and html sections:
-----------------------------
(define %number-programlisting-lines%
;; Enumerate lines in a 'ProgramListing'?
#t)
--------------------------------------------
Hope it helps! ;->)
Jonathan
Michel Goossens wrote:
> Jonathan, hello,
>
>>Thanks for the prompt response. As I am a newbie to DocBook, is it
>>possible to handhold me through this recommended setup. Where would
>>I find the XSLT stylesheet.?
>>
> As you said you got no linenumbers, you must at least have run your XML
> file through the HTML or FO stylesheets for DocBook (unless you are using
> the DSSSL setup, in which case I do not know how to proceed.
>
> In anycase, if you are using the XSL stylesheets, just make a small
> file mydocbook.xsl containing the following
> ++++++++++++++++++++++ contents of mydocbook.xsl ++++++++
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:fo="http://www.w3.org/1999/XSL/Format"
> version="1.0">
> <xsl:import
> href="/path-to-the XSL-stylesheets/docbook/xsl/fo/docbook.xsl"/>
> <!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->
> <xsl:param name="use.extensions" select="1"/>
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Where you will have to replace the /path-to-the XSL-stylesheets/
> in the <xsl:import with the directory path where your XSL stylesheets
> live.
>
> Moreover, in you use the xalan or saxon Java XSL processors, you
> should add the relevant extension jar file in the CLASSPATH. Below is
> how I run saxon here at CERN. DBEXTJAR is the variable that defines
> the extension jar lib (for saxon). I hope this is relatively clear.
>
> Grttings, mg
>
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> #!/bin/sh
> # saxon.sh Script to run Saxon XSL parser
> # Author: M.Goossens / IT
> # Last mod: 17 August 2001 (mg)
> #
>
> echo $*
>
> if [ -z "$XMLCDROM" ]; then # XMLCDROM variable not set
> echo ' '
> echo ' You should set the XMLCDROM environment variable '
> echo ' to point to the root of your XML setup '
> echo ' '
> exit 1 # abort
> fi
>
> Name=`basename $0`
> Usage="Usage: $Name source-file stylesheet-file output-file"
>
> if [ $# -lt 3 ]; then # too few parameters
> echo $Usage >&2 # display error message
> exit 1 # abort
> fi
>
> # Jar file for Saxon
> #SAXONTOP=$XMLCDROM/users.iclway.co.uk/mhkay
> SAXONTOP=$XMLCDROM/saxon.sourceforge.net
> SAXONVER=`cat $SAXONTOP/Latest`
> SAXONJARDIR=$SAXONTOP/saxon$SAXONVER
> SAXONJARS=$SAXONJARDIR/saxon.jar:$SAXONJARDIR/saxon-fop.jar:$SAXONJARDIR/saxon-jdom.jar
> # Jar file for Norm Walsh' Docbook extensions
> DBEXTJAR=$XMLCDROM/www.nwalsh.com/docbook/xsl/extensions/saxon643.jar
>
> CLASSPATH=$SAXONJARS:$DBEXTJAR:$CLASSPATH
> export CLASSPATH
>
> # Latest java needed as saved in directory
> JAVABIN=$XMLCDROM/java/jdk1.3.1/bin/java
>
> $JAVABIN -showversion com.icl.saxon.StyleSheet $1 $2 > $3
>
> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>
----------------------------------------------------------------
To subscribe or unsubscribe from this elist use the subscription
manager: <http://lists.oasis-open.org/ob/adm.pl>