docbook-apps

  • 1.  Re: [docbook-apps] Syntax Highlighting

    Posted 03-15-2007 16:43
    On 3/15/07, Bob Stayton <bobs@sagehill.net> wrote:
    > Well, I tried your command and it did not work. When I replaced the -jar
    > $SAXON with the classname com.icl.saxon.StyleSheet, it worked. Anyone know
    > why that would happen?

    More like this?

    $ ./highlight-fo6.sh -o ch09.fo ch09.xml
    /work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl
    Making portrait pages on USletter paper (8.5inx11in)
    potentially highlighting? false
    FOOO!
    Error at xsl:apply-templates on line 29 of
    file:/work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl:
    The URI java:net.sf.xslthl.ConnectorSaxon6 does not identify an
    external Java class
    Transformation failed: Run-time errors were reported
    keith@devel /work/tools/keith/scratch/wpf $ !!:gs/6/8/
    ./highlight-fo8.sh -o ch09.fo ch09.xml
    /work/tools/keith/devprod/trunk/oneoffs/highlight8.xsl
    Exception in thread "main" java.lang.NoClassDefFoundError:
    com/icl/saxon/StyleSheet
    keith@devel /work/tools/keith/scratch/wpf $ less highlight-fo*
    keith@devel /work/tools/keith/scratch/wpf $ cat highlight-fo6.sh
    highlight-fo8.sh
    #!/bin/sh
    OLD_CP=$CLASSPATH
    export CLASSPATH=""

    INVOKE="com.icl.saxon.StyleSheet"
    SAXON="/usr/share/saxon/lib/old/6.5/saxon.jar"
    SAXON_STUFF="/usr/share/saxon/lib/old/6.5/saxon-jdom.jar:/usr/share/saxon/lib/old/6.5/saxon-xml-apis.jar"
    CP6="/work/tools/keith/scratch/xslthl-cvs/build/xslthl.jar:$SAXON:$SAXON_STUFF"
    XSLTHL_CONFIG="/work/tools/docbook/highlighting/xslthl-config.xml"
    /usr/bin/java -classpath $CP6 -Dxslthl.config=$XSLTHL_CONFIG -Xmx1024m
    $INVOKE $*
    #/usr/bin/java -classpath $CP6 -Dxslthl.config=$XSLTHL_CONFIG
    -Xmx1024m -jar $SAXON -TJ $*
    export CLASSPATH=$OLD_CP

    #!/bin/sh
    SAXON="/usr/share/saxon/lib/saxon8.jar"
    INVOKE="com.icl.saxon.StyleSheet"
    CP8="/work/tools/keith/scratch/xslthl-cvs/build/classes/net/sf/xslthl/ConnectorSaxon8.class:/work/tools/keith/scratch/xslthl-cvs/build/xslthl.jar:/work/tools/keith/scratch/xslthl-cvs/build/classes/net/sf/xslthl/ConnectorSaxon8.class:$SAXON"
    OLD_CP=$CLASSPATH
    export CLASSPATH=""

    XSLTHL_CONFIG="/work/tools/docbook/highlighting/xslthl-config.xml"
    /usr/bin/java -classpath $CP8 -Dxslthl.config=$XSLTHL_CONFIG -Xmx1024m
    $INVOKE -TJ $*
    export CLASSPATH=$OLD_CP



  • 2.  Re: [docbook-apps] Syntax Highlighting

    Posted 03-15-2007 16:55
    On 3/15/07, Keith Fahlgren <abdelazer@gmail.com> wrote:
    > On 3/15/07, Bob Stayton <bobs@sagehill.net> wrote:
    > > Well, I tried your command and it did not work. When I replaced the -jar
    > > $SAXON with the classname com.icl.saxon.StyleSheet, it worked. Anyone know
    > > why that would happen?

    There were some bugs in my shell script (confusing 6 and 8). Saxon6 now runs:

    $ ./highlight-fo6.sh -o ch09.fo ch09.xml
    /work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl
    Making portrait pages on USletter paper (8.5inx11in)
    potentially highlighting? false
    FOOO!
    Loading configuration from
    file:///work/tools/docbook/highlighting/xslthl-config.xml...
    Loading java highligter from
    file:/work/tools/docbook/highlighting/java-hl.xml... OK
    Loading delphi highligter from
    file:/work/tools/docbook/highlighting/delphi-hl.xml... OK
    Loading ini highligter from
    file:/work/tools/docbook/highlighting/ini-hl.xml... OK
    Loading php highligter from
    file:/work/tools/docbook/highlighting/php-hl.xml... OK
    Loading myxml highligter from
    file:/work/tools/docbook/highlighting/myxml-hl.xml... OK
    Loading xml highligter from
    file:/work/tools/docbook/highlighting/xml-hl.xml... error
    Loading m2 highligter from file:/work/tools/docbook/highlighting/m2-hl.xml... OK
    Loading c highligter from file:/work/tools/docbook/highlighting/c-hl.xml... OK
    potentially highlighting? false

    $ less highlight-fo6.sh
    #!/bin/sh
    OLD_CP=$CLASSPATH
    export CLASSPATH=""

    INVOKE="com.icl.saxon.StyleSheet"
    SAXON="/usr/share/saxon/lib/old/6.5/saxon.jar"
    SAXON_STUFF="/usr/share/saxon/lib/old/6.5/saxon-jdom.jar:/usr/share/saxon/lib/old/6.5/saxon-xml-apis.jar"
    XSLTHL_JAR="/work/tools/docbook/highlighting/xslthl.jar"
    CP6="$XSLTHL_JAR:$SAXON:$SAXON_STUFF"
    XSLTHL_CONFIG="file:///work/tools/docbook/highlighting/xslthl-config.xml"
    /usr/bin/java -classpath $CP6 -Dxslthl.config=$XSLTHL_CONFIG -Xmx1024m
    $INVOKE $*
    #/usr/bin/java -classpath $CP6 -Dxslthl.config=$XSLTHL_CONFIG
    -Xmx1024m -jar $SAXON -TJ $*
    export CLASSPATH=$OLD_CP



    I'll write a postmortem once I ensure I'm getting correct output...


    Thanks,
    Keith



  • 3.  Re: [docbook-apps] Syntax Highlighting

    Posted 03-15-2007 18:14
    On 3/15/07, Keith Fahlgren <abdelazer@gmail.com> wrote:
    > On 3/15/07, Keith Fahlgren <abdelazer@gmail.com> wrote:
    > > On 3/15/07, Bob Stayton <bobs@sagehill.net> wrote:
    > > > Well, I tried your command and it did not work. When I replaced the -jar
    > > > $SAXON with the classname com.icl.saxon.StyleSheet, it worked. Anyone know
    > > > why that would happen?

    For the record

    "#

    Option 1: Run Saxon using the command java -jar saxon.jar source.xml
    stylesheet.xsl

    Note that the -jar option causes the classpath to be ignored. This
    means that it's not possible to use this approach when the stylesheet
    invokes extension functions, or when it uses an XML parser other than
    the default AElfred parser supplied with Saxon.
    #

    "
    http://saxon.sourceforge.net/saxon6.5.4/