docbook-apps

  • 1.  xinclude problem - docbook or xmllint?

    Posted 05-22-2009 08:33
    Using docbook v5 and xmllint

    source

    <literallayout>
    <xi:include parse="text"
    href="CatalogManager.properties">
    <xi:fallback><para><emphasis>FIXME: MISSING XINCLUDE CONTENT -
    CatalogManager.properties</emphasis></para>
    </xi:fallback>
    </xi:include>
    </literallayout>


    If the @href contains an error (file does not exist)
    then Jing reports

    jing:
    [echo] Validate using Jing
    [java] /files/docbook/tmp.xml:2138:47: error: element "para" from
    namespace "http://docbook.org/ns/docbook" not allowed in this context
    [java] Java Result: 1


    which is ... sort of wrong? An error,
    but incorrectly reported?

    Correct the typo (i.e. correct filename) and all's well.

    xmllint, Jing or ....

    I'm expanding with xmllint, then using Jing to validate the resulting
    expanded file




    regards

    --
    Dave Pawson
    XSLT XSL-FO FAQ.
    http://www.dpawson.co.uk



  • 2.  Re: [docbook-apps] xinclude problem - docbook or xmllint?

    Posted 05-22-2009 13:12
    From your description, it sounds like the XInclude is failing because
    of the incorrect URL. xmllint thus copies the contents of the
    xi:fallback element into the result, meaning that by the time Jing sees
    it, you have a <literrallayout> that contains a <para>, which is invalid:

    http://www.docbook.org/tdg5/en/html/literallayout.html

    (note also that xmllint can handle RelaxNG validation but not the
    compact syntax, so you might be able to do it all in one go)

    HTH,

    AC


    DavePawson wrote:
    > Using docbook v5 and xmllint
    >
    > source
    >
    > <literallayout>
    > <xi:include parse="text"
    > href="CatalogManager.properties">
    > <xi:fallback><para><emphasis>FIXME: MISSING XINCLUDE CONTENT -
    > CatalogManager.properties</emphasis></para>
    > </xi:fallback>
    > </xi:include>
    > </literallayout>
    >
    >
    > If the @href contains an error (file does not exist)
    > then Jing reports
    >
    > jing:
    > [echo] Validate using Jing
    > [java] /files/docbook/tmp.xml:2138:47: error: element "para" from
    > namespace "http://docbook.org/ns/docbook" not allowed in this context
    > [java] Java Result: 1
    >
    >
    > which is ... sort of wrong? An error,
    > but incorrectly reported?
    >
    > Correct the typo (i.e. correct filename) and all's well.
    >
    > xmllint, Jing or ....
    >
    > I'm expanding with xmllint, then using Jing to validate the resulting
    > expanded file
    >
    >
    >
    >
    > regards
    >




  • 3.  Re: [docbook-apps] xinclude problem - docbook or xmllint?

    Posted 05-22-2009 14:04
    Adam Constabaris wrote:
    > From your description, it sounds like the XInclude is failing because
    > of the incorrect URL.

    Yes, that's right.


    xmllint thus copies the contents of the
    > xi:fallback element into the result, meaning that by the time Jing sees
    > it, you have a <literrallayout> that contains a <para>, which is invalid:
    >
    > http://www.docbook.org/tdg5/en/html/literallayout.html

    Doh! Of course.
    Thanks David.
    Can't have para inside literallayout.


    >
    > (note also that xmllint can handle RelaxNG validation but not the
    > compact syntax, so you might be able to do it all in one go)

    Can it!

    Live and learn. Thanks Adam


    regards

    --
    Dave Pawson
    XSLT XSL-FO FAQ.
    http://www.dpawson.co.uk