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] <programlisting linenumbering="numbered"> does not number...

Comments inline

Bob - correct me if I'm wrong please.

On 12 February 2017 at 20:58,  <stimits@comcast.net> wrote:
> Hi,
> I'm curious about the mix of components for Saxon. In the original CLASSPATH
> I've been using with the Saxon jar files distributed with DocBook 5.1 and
> and the highlighter, I've used this:
> docbook5/stylesheet/docbook-xsl-ns-1.79.1/tools/lib/saxon.jar
> docbook5/stylesheet/docbook-xsl-ns-1.79.1/extensions/saxon65.jar
> xslthl-2.1.3/xslthl-2.1.3.jar
> I'm thinking "extensions/saxon65.jar" is probably the version 6.5, and that
> the implementation of "com.icl.saxon.StyleSheet" (which is what is called on
> the java command line) is from saxon.jar. I see that those files
> (distributed with DocBook 1.79.1) also make available "saxon9he.jar", so
> I've experimented with replacing "saxon.jar" with "saxon9he.jar". When I do
> this java is no longer able to find "com.icl.saxon.StyleSheet":
> Error: Could not find or load main class com.icl.saxon.StyleSheet

The second 'saxon' jar is extended to include docbook processing. It
is not the prime transform jar file AFAIK

> ...is there an alternate implementation for "com.icl.saxon.StyleSheet" when
> using saxon9he.jar, or am I going about getting saxon9 the wrong way? I have
> not been able to get a valid command line with direct java calls naming
> saxon9he.jar.

For understanding, write a 3 line docbook (or any xml file)
and transform it using xslt.
   use saxon 6.5 and you'll get xslt 1.0
    Use saxon 7+ (ideally the latest from sourceforge) and you'll get
   xslt 2.0 (and the stylesheet will need to match)

Then you can start doing docbook processing.
Some (bit of research needed) docbook processing needs
java 'extensions' which are called up from the xslt.
That's where the second jar file comes in. *NOT* for the
prime transform?

> My installed Linux has "Saxon-HE from Saxonica" by means of the
> Linux Fedora packages, and has a command line wrapper shell script "saxon".

I too use Fedora 25, 64 bit, but still install and access the
seperate saxon 9 file for transforms. Likely the same but
I can't confirm that.

> The syntax to use the Linux saxon 9 wrapper script is different than calling
> java jar files directly as an argument to "java". While trying to drop
> calling java directly, and to adapt to this newer wrapper script syntax, my
> experiments finally got past outright failure before starting...but then it
> fails immediately after starting with this message: warning: "Running an
> XSLT 1 stylesheet with an XSLT 2 processor".

Ask Bob or the team about that. You do need a 'version = 2.0'
declaration in the stylesheets, but note it is a warning?
  In theory, a 2.0 processor can process a 1.0 stylesheet, though
there are issues (odd cases).

IMHO you need to understand the xslt process. Basically
java -cp .. main.method, sourceXML, stylesheet, output.
See http://www.saxonica.com/html/documentation/using-xsl/commandline.html
for full detail

> Is DocBook 1.79.1 combined with xslthl-2.1.3 a mix of XSLT 1 and 2? I'm
> struggling to find the right tool combination...since DocBook 1.79.1 ships
> with both saxon.jar and saxon9he.jar perhaps some "magic combination" of jar
> files would solve the missing highlighting. Other people have had this work,
> so I must still be missing some detail about how I am using Saxon for
> highlighting.

I can't answer that - I don't peek into the corners so don't trip over
this issue.  Wait till Bob or the team answer?


> Thanks!
> ----- Original Message -----
> From: Dave Pawson <dave.pawson@gmail.com>
> To: stimits@comcast.net
> Cc: Docbook <docbook-apps@lists.oasis-open.org>
> Sent: Sun, 12 Feb 2017 19:06:52 -0000 (UTC)
> Subject: Re: [docbook-apps] <programlisting linenumbering="numbered"> does
> not number...
> It would seem you need to switch to XSLT 2.0 (Saxon from Sourceforge?)
> to get your highlighting.
> 6.5 is xslt 1.0
> you're not the only one to 'fight' through all the combinations
> before you get what you want :-)
> On 12 February 2017 at 17:31, <stimits@comcast.net> wrote:
>> Hi,
>> "highlight.source" is set to "1" in "fo/param.xsl" (I'm creating an fo
>> file
>> which is then converted to pdf via fop...looking at the fo file I can
>> verify
>> it isn't fop skipping the highlighting...the original fo file does not
>> contain highlighting). Other changes in the param.xsl file show up, so I
>> know I'm using the right file. Still no highlighting.
>> I have two exactly matching versions of xslthl-config.xml ("exactly
>> matching" verified with diff). I've tried specifying xslthl-config.xml
>> with
>> the "-Dxslthl.config=" parameter using either full path without URL
>> notation
>> and with URL notation (the file:// notation). FYI, one version of
>> xslthl-config.xml is the one which came with DocBook 5.1, the other
>> exactly
>> matching xslthl-config.xml came with the sourceforge.net download of
>> xslthl-2.1.3.
>> The "language=" of the programlisting tag matches the id's of
>> xslthl-config.xml (I've tried bourne and ini so far).
>> Searching for other highlight.source info I grep'd through other files and
>> saw file "highlighting/README". The content of this file has this excerpt:
>> ...
>> Note: Saxon 8.5 or later is also supported, but since it is an XSLT 2.0
>> processor it is not guaranteed to work with DocBook-XSL in all
>> circumstances.
>> ...
>> The version of Saxon being used came with DocBook 5.1 (the jar file), and
>> should work:
>> SAXON 6.5.5 from Michael Kay
>> For reference the CLASSPATH contains:
>> docbook5/stylesheet/docbook-xsl-ns-1.79.1/tools/lib/saxon.jar
>> docbook5/stylesheet/docbook-xsl-ns-1.79.1/extensions/saxon65.jar
>> xslthl-2.1.3/xslthl-2.1.3.jar
>> Is there any way (short of editing source code) to find out if
>> xslthl-2.1.3.jar is even called when language="bourne" or language="ini"
>> are
>> specified? Syntax highlighting would be a valuable tool, but it just feels
>> like I'll end up skipping actual content writing if I have to debug at the
>> source code level...and the issue is probably just something simple I've
>> overlooked, but I do not have the experience to know what to look at.
>> Thanks!
>> ----- Original Message -----
>> From: Dave Pawson <dave.pawson@gmail.com>
>> To: stimits@comcast.net
>> Cc: Docbook <docbook-apps@lists.oasis-open.org>
>> Sent: Sun, 12 Feb 2017 07:37:22 -0000 (UTC)
>> Subject: Re: [docbook-apps] <programlisting linenumbering="numbered"> does
>> not number...
>> http://docbook.sourceforge.net/release/xsl/current/doc/html/highlight.source.html
>> Have you 'switched it on' via the parameter settings?
>> HTH
>> On 11 February 2017 at 20:42, <stimits@comcast.net> wrote:
>>> Hi,
>>> From the link on Saxon plus other information I put together the simplest
>>> test case (which sort of works). The command is essentially this (other
>>> commands validate the XML with jing and xmllint before calling Saxon):
>>> java \
>>> -Dxslthl.config=${XSLTHL}/highlighters/xslthl-config.xml \
>>> com.icl.saxon.StyleSheet \
>>> -o ${OBJ}/${TITLE}_monolithic.fo \
>>> ${OBJ}/${TITLE}_monolithic.xml \
>>> ${XSLT}/fo/docbook.xsl \
>>> use.extensions=1
>>> This does enable line numbering in programlisting tags, and options
>>> related
>>> to numbering do as expected. However, in attempting to get the syntax
>>> highlighting to work (see
>>> http://www.sagehill.net/docbookxsl/SyntaxHighlighting.html) nothing I've
>>> tried has any effect (test cases were with "bourne" and "ini" files).
>>> The CLASSPATH contains the following files, and no error occurs (for the
>>> sake of brevity I'm showing only the relative paths, but the full path is
>>> used without error in the actual Makefile):
>>> docbook-xsl-ns-1.79.1/tools/lib/saxon.jar:docbook5/stylesheet/docbook-xsl-ns-1.79.1/extensions/saxon65.jar:xml/xslthl-2.1.3/xslthl-2.1.3.jar
>>> Since I get no errors, and because the Saxon processing is otherwise
>>> working, is there any additional requirement to keep syntax highlighting
>>> from failing as if the option did not exist? Is syntax highlighting
>>> something which maybe requires the Xalan parser? Is there perhaps
>>> something
>>> from param.xsl which needs to change and not mentioned in the above URL
>>> on
>>> syntax highlighting?
>>> Thanks!
>>> ----- Original Message -----
>>> From: Richard Hamilton <hamilton@xmlpress.net>
>>> To: stimits@comcast.net
>>> Cc: Docbook <docbook-apps@lists.oasis-open.org>
>>> Sent: Sat, 11 Feb 2017 00:50:21 -0000 (UTC)
>>> Subject: Re: [docbook-apps] <programlisting linenumbering="numbered">
>>> does
>>> not number...
>>> Hi,
>>> Here is the link to the part of Bob’s book that covers the Saxon
>>> processor:
>>> http://sagehill.net/docbookxsl/InstallingAProcessor.html#InstallSaxon
>>> I think you can keep the xmllint processing as is (I use it for XInclude
>>> processing, too), and just swap in saxon for xsltproc, using Bob’s
>>> instructions.
>>> I don’t bother swapping in Xerces (I don’t use any of the features that
>>> go
>>> beyond what Saxon supports).
>>> Best regards,
>>> Dick
>>> -------
>>> XML Press
>>> XML for Technical Communicators
>>> http://xmlpress.net
>>> hamilton@xmlpress.net
>>>> On Feb 10, 2017, at 12:26, stimits@comcast.net wrote:
>>>> Hi,
>>>> I was going by this reference as to requirements, and have not read the
>>>> whole book (thus I did not yet see the Java requirement):
>>>> http://tdg.docbook.org/tdg/5.1/programlisting.html
>>>> Admittedly I'm trying to do something quicker than I should and not
>>>> reading everything (I've been through a lot of material, but it's just a
>>>> drop in the bucket for everything needed when I really just need to sit
>>>> down
>>>> and write content). I've had some frustrations getting the Java-based
>>>> processors working and have tried to stick to the xmllint/jing/xsltproc
>>>> family for that single reason. The Java-based processing answer likely
>>>> also
>>>> answers my earlier syntax highlighting question about whether to abandon
>>>> my
>>>> current approach with xmllint.
>>>> To use Saxon or Xalan I would have to change the current build scheme,
>>>> which I've never succeeded at:
>>>> xmllint --output "${OBJ}/${TITLE}_monolithic.xml" --nonet --noent
>>>> -xinclude "${CONTENT}/${TITLE}.xml"
>>>> xsltproc --output ${OBJ}/${TITLE}_monolithic.fo ${XSLT}/docbook.xsl
>>>> ${OBJ}/${TITLE}_monolithic.xml
>>>> fop -c ${PREFIX}/fop.xconf -fo ${OBJ}/${TITLE}_monolithic.fo -pdf
>>>> ${OUT}/${TITLE}.pdf
>>>> I realize I'm probably asking a lot, but is there any advice I can get
>>>> on
>>>> editing that chain of commands to instead work with Saxon or Xalan?
>>>> Getting
>>>> past the tools on the command line (for a hand written Makefile) is just
>>>> getting frustrating and is why the current chain of commands have never
>>>> evolved to anything Java-based.
>>>> I do plan on reading more (I'm not resisting reading), but there are
>>>> other
>>>> requirements which tend to require at least a draft to be available
>>>> sooner
>>>> rather than later.
>>>> Thanks!
>>>> ----- Original Message -----
>>>> From: Bob Stayton <bobs@sagehill.net>
>>>> To: stimits@comcast.net, Docbook <docbook-apps@lists.oasis-open.org>
>>>> Sent: Fri, 10 Feb 2017 19:09:00 -0000 (UTC)
>>>> Subject: Re: [docbook-apps] <programlisting linenumbering="numbered">
>>>> does
>>>> not number...
>>>> Hi,
>>>> Did you read this section in my online book about line numbering? It
>>>> only works with Java-based processors.
>>>> Bob Stayton
>>>> Sagehill Enterprises
>>>> bobs@sagehill.net
>>>> On 2/10/2017 11:01 AM, stimits@comcast.net wrote:
>>>> > Hi,
>>>> >
>>>> > Under DocBook 5.1 I've been able to list programs, but line numbering
>>>> > has no effect (and there is no error under xmllint or jing). Is there
>>>> > some ENTITY or other precondition required for line numbering under
>>>> > 5.1?
>>>> >
>>>> > Thanks!
>> --
>> Dave Pawson
>> Docbook FAQ.
>> http://www.dpawson.co.uk
> --
> Dave Pawson
> Docbook FAQ.
> http://www.dpawson.co.uk

Dave Pawson
Docbook FAQ.

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