docbook-apps

  • 1.  Re: [docbook-apps] hours to process chunks

    Posted 09-06-2011 18:05
    On Sat, Sep 3, 2011 at 5:19 AM, Jirka Kosek <jirka@kosek.cz> wrote:
    > On 2.9.2011 21:24, Tim Arnold wrote:
    >
    >> Well great, at least in my browser the columns don't line up any
    >> longer. I'll try to attach a file with the profile results.
    >> I'm not sure what to make of the information--does it mean that the
    >> most time was taken up by footnotes?
    >
    > Yes. Footnotes are slowing down your transformation most. Because
    > footnote number can be affected also with links placed as footnotes
    > (ulink.footnotes parameter) and footnotes in tables are numbered
    > separatedly expression for calculating footnote label is not simple:
    >
    > <xsl:number level="any"
    >
    > from="d:chapter|d:appendix|d:preface|d:article|d:refentry|d:bibliography"
    >
    > count="d:footnote[not(@label)][not(ancestor::d:table) and
    > not(ancestor::d:informaltable)]
    >                    |d:ulink[$ulink.footnotes != 0][node()][@url !=
    > .][not(ancestor::d:footnote)][$ulink.show != 0]
    >                    |*[node()][@xlink:href][not(@xlink:href =
    > .)][not(starts-with(@xlink:href,'#'))]
    >                      [not(contains(@xlink:href,'#') and @xlink:role =
    > $xolink.role)]
    >                      [not(@xlink:type) or @xlink:type='simple']
    >                      [not(ancestor::d:footnote)][$ulink.footnotes !=
    > 0][$ulink.show != 0]
    >                    "
    >                    format="1"/>
    >
    >
    > If you don't use ulink footnotes and footnotes in tables you can
    > override this template and use just:
    >
    > <xsl:number level="any"
    >
    > from="d:chapter|d:appendix|d:preface|d:article|d:refentry|d:bibliography"
    >                    count="d:footnote[not(@label)]" format="1"/>
    >
    > That should bring speedup. Also if documents are relatively stable you
    > can run additional preprocessing step and assign footnote number into
    > label attribute to skip evaluation of this rather complex expression.
    >
    > Also have you already tried Saxon as suggested. With complex documents
    > it copes faster then xsltproc.
    >
    >                                        Jirka
    >
    Hi Jirka, thanks for the information on the footnotes and the nudge to
    use saxon...

    Wow, I did just try saxon-655 and it makes a huge difference. The book
    that took hours using xsltproc now completes in
    23 minutes (my customized chunking)
    17 minutes (chunking), and
    5 minutes (no chunking).

    I also tried saxon9.30 and of course I cannot do chunking with it and
    the XSLT1.0 stylesheets, but with no chunking it finished in 1 minute
    23 seconds.

    With results like these I am looking forward to using saxon 9.3+ with
    XSLT2.0 some day. I know the 2.0 stylesheets exist in an experimental
    version, but the system I'm building now needs to be production-ready
    soon.

    thanks again!
    --Tim



  • 2.  Re: [docbook-apps] hours to process chunks

    Posted 09-13-2011 11:37
    On 6.9.2011 20:05, Tim Arnold wrote:

    > I also tried saxon9.30 and of course I cannot do chunking with it and
    > the XSLT1.0 stylesheets, but with no chunking it finished in 1 minute
    > 23 seconds.

    Actually you can do chunking with Saxon 9, see

    http://lists.oasis-open.org/archives/docbook-apps/201103/msg00123.html

    Because there were some troubles to make this code work in all XSLT 1.0
    based processors it never made up into main trunk. But it might work in
    your case. If you succeed, please let us know what performance gain was
    there and if you have faced some problems.

    Jirka


    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    ------------------------------------------------------------------




  • 3.  Re: [docbook-apps] hours to process chunks

    Posted 09-14-2011 19:53
    On Tue, Sep 13, 2011 at 7:37 AM, Jirka Kosek <jirka@kosek.cz> wrote:
    > On 6.9.2011 20:05, Tim Arnold wrote:
    >
    >> I also tried saxon9.30 and of course I cannot do chunking with it and
    >> the XSLT1.0 stylesheets, but with no chunking it finished in 1 minute
    >> 23 seconds.
    >
    > Actually you can do chunking with Saxon 9, see
    >
    > http://lists.oasis-open.org/archives/docbook-apps/201103/msg00123.html
    >
    > Because there were some troubles to make this code work in all XSLT 1.0
    > based processors it never made up into main trunk. But it might work in
    > your case. If you succeed, please let us know what performance gain was
    > there and if you have faced some problems.
    >
    >                                Jirka
    >
    Hi Jirka,
    Thanks for that information. I must be doing something wrong:

    I copied the stylesheet from that thread, removed the semicolons from
    the header element so it looks like this:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:saxon="http://icl.com/saxon"
    xmlns:lxslt="http://xml.apache.org/xslt"
    xmlns:redirect="http://xml.apache.org/xalan/redirect"
    xmlns:exsl="http://exslt.org/common"
    xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
    xmlns:ch="http://docbook.sf.net/xmlns/chunk"
    version="2.0"
    exclude-result-prefixes="doc ch saxon lxslt redirect exsl"
    extension-element-prefixes="saxon redirect lxslt exsl">

    the semicolons seemed to be errors when I tried running saxon9.
    I then replaced the original 'html/chunker.xsl' with the resulting file.

    I ran the following command:

    java -jar saxon9he.jar qcug.xml \
    /AppDocs/xml/docbook/xsl-1.76.1/html/chunk.xsl \
    current.docid=qcug \
    target.database.document=olink.xml

    and got this result:

    Warning: at xsl:stylesheet on line 5 column 50 of chunk.xsl:
    Running an XSLT 1 stylesheet with an XSLT 2 processor
    Warning: Stylesheet module
    file:/AppDocs/xml/docbook/xsl-1.76.1/common/utility.xsl is included or
    imported more than once. This is permitted, but may lead to errors
    or unexpected behavior
    Error at xsl:apply-templates on line 389 column 90 of chunker.xsl:
    XPST0017 XPath syntax error at char 0 on line 389 near
    {...ode-set($content-for-chunki...}:
    Cannot find a matching 1-argument function named
    {http://exslt.org/common}node-set().
    There is no Saxon extension function with the local name node-set
    Failed to compile stylesheet. 1 error detected.



  • 4.  Re: [docbook-apps] hours to process chunks

    Posted 09-15-2011 08:29
    Dnia sroda, 14 wrzesnia 2011 o 21:52:48 Tim Arnold napisal(a):
    > Cannot find a matching 1-argument function named
    > {http://exslt.org/common}node-set().
    > There is no Saxon extension function with the local name node-set

    You may need to consult EXSLT documentation to find out whether you can inject EXSLT into Saxon.

    HTH,
    Chris



  • 5.  Re: [docbook-apps] hours to process chunks

    Posted 09-15-2011 13:23
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    On 09/15/2011 03:29 AM, Krištof Želechovski wrote:
    > Dnia sroda, 14 wrzesnia 2011 o 21:52:48 Tim Arnold napisal(a):
    >> Cannot find a matching 1-argument function named
    >> {http://exslt.org/common}node-set().
    >> There is no Saxon extension function with the local name node-set
    >
    > You may need to consult EXSLT documentation to find out whether you can inject EXSLT into Saxon.
    >
    > HTH,
    > Chris

    The calls of exslt node-set() are unneeded in xslt 2.0. There are
    probably several instances where node-set is called outside of Jirka's
    customized version of chunker.xsl. You could override those templates
    and just remove the node-set() calls (e.g. change node-set($foo) to just
    $foo.

    David
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.11 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iQEcBAEBAgAGBQJOcfw2AAoJEMHeSXG7afUhqVIIAJqHblOEo3Z+4cv2jydJanSG
    miPUulX4TyOLxVaEN4Ks5Xp5d1UyobGFtuL2Th/rDb3ec3MOGbGiWUXQvYDKvIQv
    zPXrAGSKEmLFGNHzWyBpS+ZC6GVkbLXsdghI/jvmJhSfbSh0Bnk92k51QJFrx0JY
    vmv3OSmPX3B1+ckia24qWnBtDxv4En/HyeG4Ou5KGbicvkpiYM02xr0jysSmt63o
    wg3Ok5fUiIdN8JQ4zak5OAwAPrdlIPy8vw/jIimeocJPEGFKQOBCoVIlbcBY2r/F
    TLFjk1k1k9JCEVZcijZKzhiZOzpkN1syvyUHNHKEtXZQMMkGtmmW/gLcVbg1jyo=
    =NphX
    -----END PGP SIGNATURE-----



  • 6.  Re: [docbook-apps] hours to process chunks

    Posted 09-27-2011 14:10
    On 15.9.2011 15:23, David Cramer wrote:

    > The calls of exslt node-set() are unneeded in xslt 2.0. There are
    > probably several instances where node-set is called outside of Jirka's
    > customized version of chunker.xsl. You could override those templates
    > and just remove the node-set() calls (e.g. change node-set($foo) to just
    > $foo.

    I think that David is right. I haven't touched this code for 2 years and
    it seems that Saxon9 since then dropped EXSLT support. Anyway you can
    safely remove calls to exsl:node-set() as long as your are using XSLT
    2.0 processor.

    Jirka

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
    ------------------------------------------------------------------