docbook-apps

  • 1.  Questions about the XSLT2 stylesheets

    Posted 06-21-2012 02:11
    In working with the 2.0.3 distribution of the XSLT2. I am getting the
    following error when trying to convert a valid docbook document using
    SaxonHE 9.0.4.3 and Ant as the driver.

    The file converts when using the XSLT1 snapshot distribution and XSLTproc.

    Any ideas of what may be causing this problem?

    Thanks,
    Carlos

    validate-xml:
    [echo] Generating HTML Single File using Saxon and XSLT2.0
    [echo] Saxon 9 or another XSLT2 processor must be used
    [java] Error on line 83 of xref.xsl:
    [java] XTTE0790: An empty sequence is not allowed as the first
    argument of f:findid()
    [java] at xsl:apply-templates
    (file:/usr/local/docbook/2.0/release/2.0.3/xslt/base/html/blocks.xsl#86)
    [java] processing
    /book/chapter[5]/sect1[1]/itemizedlist[1]/listitem[5]/para[1]/link[2]
    [java] at xsl:apply-templates
    (file:/usr/local/docbook/2.0/release/2.0.3/xslt/base/html/lists.xsl#69)
    [java] processing
    /book/chapter[5]/sect1[1]/itemizedlist[1]/listitem[5]/para[1]
    [java] at xsl:apply-templates
    (file:/usr/local/docbook/2.0/release/2.0.3/xslt/base/html/lists.xsl#29)
    [java] processing
    /book/chapter[5]/sect1[1]/itemizedlist[1]/listitem[5]
    [java] at xsl:apply-templates
    (file:/usr/local/docbook/2.0/release/2.0.3/xslt/base/html/section.xsl#19)
    [java] processing /book/chapter[5]/sect1[1]/itemizedlist[1]
    [java] at xsl:apply-templates
    (file:/usr/local/docbook/2.0/release/2.0.3/xslt/base/html/component.xsl#25)
    [java] processing /book/chapter[5]/sect1[1]
    [java] at xsl:apply-templates
    (file:/usr/local/docbook/2.0/release/2.0.3/xslt/base/html/division.xsl#23)
    [java] processing /book/chapter[5]
    [java] at xsl:apply-templates
    (file:/usr/local/docbook/2.0/release/2.0.3/xslt/base/html/docbook.xsl#89)
    [java] processing /book
    [java] Transformation failed: Run-time errors were reported



  • 2.  Re: Questions about the XSLT2 stylesheets

    Posted 06-21-2012 03:04
    I found out what the problem is. The element that causes the error is this:

    <listitem><para>xlink:href="http://xmlsoft.org/xslt/xsltproc2.html">XSLTProc,
    part of the XSLT library. This library lives on top of xlink:hef="http://xmlsoft.org/">LibXML. Install LibXML first
    and then LibXSLT otherwise XSLTProc will not work. You need to have
    LibXML installed before installing LibXSLT and
    XSLTProc.</para></listitem>

    When I comment out the second link inside the listitem>para the
    document converts without a problem.

    Should I file this on github issues tracker?

    Carlos

    On Wed, Jun 20, 2012 at 7:11 PM, Carlos Araya <carlos.araya@gmail.com> wrote:
    > In working with the 2.0.3 distribution of the XSLT2. I am getting the
    > following error when trying to convert a valid docbook document using
    > SaxonHE 9.0.4.3 and Ant as the driver.
    >
    > The file converts when using the XSLT1 snapshot distribution and XSLTproc.
    >
    > Any ideas of what may be causing this problem?
    >
    > Thanks,
    > Carlos
    >
    > validate-xml:
    >     [echo] Generating HTML Single File using Saxon and XSLT2.0
    >     [echo] Saxon 9 or another XSLT2 processor must be used
    >     [java] Error on line 83 of xref.xsl:
    >     [java]   XTTE0790: An empty sequence is not allowed as the first
    > argument of f:findid()
    >     [java]   at xsl:apply-templates
    > (file:/usr/local/docbook/2.0/release/2.0.3/xslt/base/html/blocks.xsl#86)
    >     [java]      processing
    > /book/chapter[5]/sect1[1]/itemizedlist[1]/listitem[5]/para[1]/link[2]
    >     [java]   at xsl:apply-templates
    > (file:/usr/local/docbook/2.0/release/2.0.3/xslt/base/html/lists.xsl#69)
    >     [java]      processing
    > /book/chapter[5]/sect1[1]/itemizedlist[1]/listitem[5]/para[1]
    >     [java]   at xsl:apply-templates
    > (file:/usr/local/docbook/2.0/release/2.0.3/xslt/base/html/lists.xsl#29)
    >     [java]      processing
    > /book/chapter[5]/sect1[1]/itemizedlist[1]/listitem[5]
    >     [java]   at xsl:apply-templates
    > (file:/usr/local/docbook/2.0/release/2.0.3/xslt/base/html/section.xsl#19)
    >     [java]      processing /book/chapter[5]/sect1[1]/itemizedlist[1]
    >     [java]   at xsl:apply-templates
    > (file:/usr/local/docbook/2.0/release/2.0.3/xslt/base/html/component.xsl#25)
    >     [java]      processing /book/chapter[5]/sect1[1]
    >     [java]   at xsl:apply-templates
    > (file:/usr/local/docbook/2.0/release/2.0.3/xslt/base/html/division.xsl#23)
    >     [java]      processing /book/chapter[5]
    >     [java]   at xsl:apply-templates
    > (file:/usr/local/docbook/2.0/release/2.0.3/xslt/base/html/docbook.xsl#89)
    >     [java]      processing /book
    >     [java] Transformation failed: Run-time errors were reported



  • 3.  Re: [docbook-apps] Re: Questions about the XSLT2 stylesheets

    Posted 06-21-2012 05:23
    Hi Carlos,

    On Wed, 20 Jun 2012 20:04:18 -0700
    Carlos Araya <carlos.araya@gmail.com> wrote:

    > I found out what the problem is. The element that causes the error
    > is this:
    >
    > <listitem><para>> xlink:href="http://xmlsoft.org/xslt/xsltproc2.html">XSLTProc,
    > part of the XSLT library. This library lives on top of > xlink:hef="http://xmlsoft.org/">LibXML. Install LibXML first
    ^^^^^^^^^

    Is this a copy and past error? Otherwise this is a typo as there is no
    "hef" attribute in XLink. :) Try it as xlink:href like in the first link
    and it should work.


    > [...]


    --
    Gruß/Regards,
    Thomas Schraitle



  • 4.  Re: [docbook-apps] Re: Questions about the XSLT2 stylesheets

    Posted 06-21-2012 16:20
    Good morning:

    It was indeed a typo and thanks to Thomas the problem is solved.

    But this bring up a couple more questions.

    I always validate the XML document before running the transformation
    and it always validates using XMLLint. but it didn't catch this error.
    Is there a way to validate xlink elements within docbook?

    Thee behavior with the XSLT1 (snapshot) distribution is to ignore the
    link altogether. Is there a way to maybe flag it as a warning so we
    can look at the xml and see where the error is?

    Carlos

    On Wed, Jun 20, 2012 at 10:23 PM, Thomas Schraitle <tom_schr@web.de> wrote:
    > Hi Carlos,
    >
    > On Wed, 20 Jun 2012 20:04:18 -0700
    > Carlos Araya <carlos.araya@gmail.com> wrote:
    >
    >> I found out  what the problem is. The element that causes the error
    >> is this:
    >>
    >>               <listitem><para>>> xlink:href="http://xmlsoft.org/xslt/xsltproc2.html">XSLTProc,
    >> part of the XSLT library. This library lives on top of >> xlink:hef="http://xmlsoft.org/">LibXML. Install LibXML first
    >  ^^^^^^^^^
    >
    > Is this a copy and past error? Otherwise this is a typo as there is no
    > "hef" attribute in XLink. :) Try it as xlink:href like in the first link
    > and it should work.
    >
    >
    >> [...]
    >
    >
    > --
    > Gruß/Regards,
    >    Thomas Schraitle
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >



  • 5.  Re: [docbook-apps] Re: Questions about the XSLT2 stylesheets

    Posted 06-21-2012 16:50
    Hi Carlos,


    Am Donnerstag, 21. Juni 2012, 09:19:53 schrieb Carlos Araya:
    > Good morning:

    That's relative. ;-)


    > [...]
    > I always validate the XML document before running the transformation
    > and it always validates using XMLLint. but it didn't catch this error.
    > Is there a way to validate xlink elements within docbook?

    I cannot recommend xmllint in regards to RELAX NG. Unfortunately, I was never
    able to validate my DocBook 5 documents against the DocBook RNG schema. ;-(
    Better use Jing.


    > Thee behavior with the XSLT1 (snapshot) distribution is to ignore the
    > link altogether. Is there a way to maybe flag it as a warning so we
    > can look at the xml and see where the error is?

    Well, consider this snippet with the same typo than your document (xlink:hef
    instead of xlink:href):

    <para>This links to the xlink:hef="http://www.docbook.org">DocBook site.</para>

    Validate the XML file which contains the above snippet using this command:

    $ jing -c docbook.rnc db5-xlink.xml

    That gives me the following error:

    db5-xlink.xml:7:40: error: attribute "xlink:hef" not allowed here; expected
    attribute "annotations", "arch", "audience", "condition", "conformance",
    "dir", "endterm", "linkend", "os", "remap", "revision", "revisionflag",
    "role", "security", "userlevel", "vendor", "version", "wordsize",
    "xlink:actuate", "xlink:arcrole", "xlink:href", "xlink:role", "xlink:show",
    "xlink:title", "xlink:type", "xml:base", "xml:id", "xml:lang", "xreflabel" or
    "xrefstyle"
    /tmp/db5-xlink.xml:7:40: error: element "link" missing one or more required
    attributes; expected attribute "annotations", "arch", "audience", "condition",
    "conformance", "dir", "endterm", "linkend", "os", "remap", "revision",
    "revisionflag", "role", "security", "userlevel", "vendor", "version",
    "wordsize", "xlink:actuate", "xlink:arcrole", "xlink:href", "xlink:role",
    "xlink:show", "xlink:title", "xlink:type", "xml:base", "xml:id", "xml:lang",
    "xreflabel" or "xrefstyle"

    As you can see, the wrong attribute is indeed reported. The only issue you
    have is that xmllint is broken.

    The moral of the story: use jing. :)


    --
    Gruß/Regards
    Thomas Schraitle