docbook-apps

  • 1.  Should xmllint successfully validate docbook 5 containing XIncludes?

    Posted 10-28-2013 10:35
    I'm trying to validate some documents generated by the db4-upgrade.xsl from
    existing (validating) db4 documents. Validating the resulting db5 results in
    mysterious errors that don't seem to correspond to actual problems. Eventually I
    figured out that if I inlined content that had originally been XIncluded, the
    errors went away. The especially mystifying part is that the reported errors
    are in parts of the document having nothing to do with the apparently
    offending xi:include element.
    Should I expect xmllint to operate properly with XIncludes? xmllint doesn't
    have any problems validating the original db4 documents, which also contain
    XIncludes, so it seems to be somehow related to db5, but I'm out of my depth at
    this point.
    I've attached a (relatively) minimal case below; valid.xml inlines
    the file, invalid.xml instead XIncludes it. Running

    xmllint --noout --xinclude --relaxng http://docbook.org/xml/5.0/rng/docbook.rng valid.xml invalid.xml

    results in

    valid.xml validates
    invalid.xml:27: element variablelist: Relax-NG validity error : Expecting element example, got variablelist
    invalid.xml:37: element variablelist: Relax-NG validity error : Element refsection has extra content: variablelist
    invalid.xml:34: element refsection: Relax-NG validity error : Element refentry has extra content: refsection
    invalid.xml fails to validate

    but the xi:include element in invalid.xml doesn't occur until line 48, well
    after the reported errors.

    I attempted using jing on these documents to try and see if this behavior
    is an xmllint-specific problem, but it appears to just hang up forever (not the
    case with other schema and documents I've used jing on). Are there any
    other validators I should be trying on Debian 7?

    Thanks,
    Jon Leech


    Attachment(s)

    xml
    baseformattable.xml   1 KB 1 version
    xml
    invalid.xml   1 KB 1 version
    xml
    valid.xml   3 KB 1 version


  • 2.  Re: [docbook-apps] Should xmllint successfully validate docbook 5 containing XIncludes?

    Posted 10-29-2013 05:31
    The short answer is no, xmllint does not successfully validate DocBook 5
    documents that are in fact valid.

    I normally use Jing to validate DocBook 5. I've not seen it hang like you
    have.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net

    --------------------------------------------------
    From: "Jon Leech" <jon@alumni.caltech.edu>
    Sent: Monday, October 28, 2013 3:34 AM
    To: <docbook-apps@lists.oasis-open.org>
    Subject: [docbook-apps] Should xmllint successfully validate docbook 5
    containing XIncludes?

    > I'm trying to validate some documents generated by the db4-upgrade.xsl
    > from
    > existing (validating) db4 documents. Validating the resulting db5 results
    > in
    > mysterious errors that don't seem to correspond to actual problems.
    > Eventually I
    > figured out that if I inlined content that had originally been XIncluded,
    > the
    > errors went away. The especially mystifying part is that the reported
    > errors
    > are in parts of the document having nothing to do with the apparently
    > offending xi:include element.
    > Should I expect xmllint to operate properly with XIncludes? xmllint
    > doesn't
    > have any problems validating the original db4 documents, which also
    > contain
    > XIncludes, so it seems to be somehow related to db5, but I'm out of my
    > depth at
    > this point.
    > I've attached a (relatively) minimal case below; valid.xml inlines
    > the file, invalid.xml instead XIncludes it. Running
    >
    > xmllint --noout --xinclude --relaxng
    > http://docbook.org/xml/5.0/rng/docbook.rng valid.xml invalid.xml
    >
    > results in
    >
    > valid.xml validates
    > invalid.xml:27: element variablelist: Relax-NG validity error : Expecting
    > element example, got variablelist
    > invalid.xml:37: element variablelist: Relax-NG validity error : Element
    > refsection has extra content: variablelist
    > invalid.xml:34: element refsection: Relax-NG validity error : Element
    > refentry has extra content: refsection
    > invalid.xml fails to validate
    >
    > but the xi:include element in invalid.xml doesn't occur until line 48,
    > well
    > after the reported errors.
    >
    > I attempted using jing on these documents to try and see if this
    > behavior
    > is an xmllint-specific problem, but it appears to just hang up forever
    > (not the
    > case with other schema and documents I've used jing on). Are there any
    > other validators I should be trying on Debian 7?
    >
    > Thanks,
    > Jon Leech
    >
    >



    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org




  • 3.  Re: [docbook-apps] Should xmllint successfully validate docbook 5 containing XIncludes?

    Posted 10-29-2013 09:54
    On 10/28/2013 10:31 PM, Bob Stayton wrote:
    > The short answer is no, xmllint does not successfully validate DocBook 5 documents that are in fact valid.
    >
    > I normally use Jing to validate DocBook 5. I've not seen it hang like you have.

    Thanks, that's good to know going forward. It turns out that stripping the

    "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd">
    %mathml;
    ]>

    prolog from my documents will prevent jing from hanging. Unfortunately it will also
    prevent some of them from validating, since they use MathML entities like ⌊ .
    I filed a bug on the jing project page to ask about this but perhaps I'm missing
    some other way to be able to use these entities that would work around this issue?

    Jon Leech




  • 4.  Re: [docbook-apps] Should xmllint successfully validate docbook 5 containing XIncludes?

    Posted 10-30-2013 20:24
    Have you tried using the namespace declaration in your document?

    Something like this:


    xmlns='http://docbook.org/ns/docbook'
    xmlns:xlink='http://www.w3.org/1999/xlink'
    xmlns:mathml="http://www.w3.org/TR/MathML2/dtd/mathml2.dtd"
    version="5.0" xml:lang="en">



    This should replace the entity declaration and still let your mathml validate.

    HTH,

    Carlos



    On Tue, Oct 29, 2013 at 2:53 AM, Jon Leech <jon@alumni.caltech.edu> wrote:

    > On 10/28/2013 10:31 PM, Bob Stayton wrote:
    >
    >> The short answer is no, xmllint does not successfully validate DocBook 5
    >> documents that are in fact valid.
    >>
    >> I normally use Jing to validate DocBook 5. I've not seen it hang like
    >> you have.
    >>
    >
    > Thanks, that's good to know going forward. It turns out that stripping
    > the
    >
    > > > "http://www.w3.org/TR/MathML2/**dtd/mathml2.dtd<http://www.w3.org/TR/MathML2/dtd/mathml2.dtd>
    > ">
    > %mathml;
    > ]>
    >
    > prolog from my documents will prevent jing from hanging. Unfortunately it
    > will also
    > prevent some of them from validating, since they use MathML entities like
    > ⌊ .
    > I filed a bug on the jing project page to ask about this but perhaps I'm
    > missing
    > some other way to be able to use these entities that would work around
    > this issue?
    >
    >
    > Jon Leech
    >
    >
    > ------------------------------**------------------------------**---------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@**lists.oasis-open.org<docbook-apps-unsubscribe@lists.oasis-open.org>
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-**open.org<docbook-apps-help@lists.oasis-open.org>
    >
    >



  • 5.  Re: [docbook-apps] Should xmllint successfully validate docbook 5 containing XIncludes?

    Posted 10-31-2013 16:36
    Hi Jon,
    I think Carlos meant to use the official MathML namespace instead of a DTD
    reference:

    xmlns:mathml="http://www.w3.org/1998/Math/MathML"

    It seems loading the MathML DTD confused Jing. The DocBook 5 RelaxNG schema
    permits elements in the MathML namespace, but it does not try to validate
    them. But it seems your problem is recognizing the named character entities
    in the MathML DTD. If Jing does not like loading the entire MathML DTD as
    you tried, it would probably accept loading just the entity declarations
    from the DTD. You could try copying the MathML dtd to another file and
    stripping out all *but* the entity declarations. Those are conveniently
    located at the end of the DTD file. Then reference that file in the
    parameter entity in the DOCTYPE to load those entities.

    Then Jing should validate against the DocBook 5 RNG schema. If you also
    want to validate the embedded MathML elements, you will need a validator
    compatible with NVDL such as oNVDL ( http://www.oxygenxml.com/onvdl.html ).

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    From: Carlos Araya
    Sent: Wednesday, October 30, 2013 1:24 PM
    To: docbook-apps@lists.oasis-open.org
    Subject: Re: [docbook-apps] Should xmllint successfully validate docbook 5
    containing XIncludes?


    Have you tried using the namespace declaration in your document?


    Something like this:



    xmlns:xlink='http://www.w3.org/1999/xlink'
    xmlns:mathml="http://www.w3.org/TR/MathML2/dtd/mathml2.dtd"
    version="5.0" xml:lang="en">

    This should replace the entity declaration and still let your mathml
    validate.
    HTH,Carlos



    On Tue, Oct 29, 2013 at 2:53 AM, Jon Leech <jon@alumni.caltech.edu> wrote:

    On 10/28/2013 10:31 PM, Bob Stayton wrote:

    The short answer is no, xmllint does not successfully validate DocBook 5
    documents that are in fact valid.

    I normally use Jing to validate DocBook 5. I've not seen it hang like you
    have.



    Thanks, that's good to know going forward. It turns out that stripping
    the

    "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd">
    %mathml;
    ]>

    prolog from my documents will prevent jing from hanging. Unfortunately it
    will also
    prevent some of them from validating, since they use MathML entities like ?
    .
    I filed a bug on the jing project page to ask about this but perhaps I'm
    missing
    some other way to be able to use these entities that would work around this
    issue?


    Jon Leech


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org




  • 6.  Re: [docbook-apps] Should xmllint successfully validate docbook 5 containing XIncludes?

    Posted 10-31-2013 17:10
    On 31.10.2013 17:36, Bob Stayton wrote:
    > character entities in the MathML DTD. If Jing does not like loading the
    > entire MathML DTD as you tried, it would probably accept loading just
    > the entity declarations from the DTD. You could try copying the MathML
    > dtd to another file and stripping out all *but* the entity
    > declarations. Those are conveniently located at the end of the DTD
    > file. Then reference that file in the parameter entity in the DOCTYPE
    > to load those entities.

    There is no need to create manually DTD with just entity definitions.
    Such entity definitions are already premade and available online, see:
    http://docbook.org/docs/howto/#faq-authoring-general-entities

    and

    http://www.w3.org/2003/entities/2007doc/Overview.html


    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 rep.
    ------------------------------------------------------------------
    Bringing you XML Prague conference http://xmlprague.cz
    ------------------------------------------------------------------




  • 7.  Catalog setup issues in using MathML entity sets (was Re: Should xmllint successfully validate docbook 5 containing XIncludes?)

    Posted 11-01-2013 07:29
    On 10/31/2013 09:36 AM, Bob Stayton wrote:
    > Hi Jon,
    > I think Carlos meant to use the official MathML namespace instead of a DTD reference:
    >
    > xmlns:mathml="http://www.w3.org/1998/Math/MathML"
    >
    > It seems loading the MathML DTD confused Jing. The DocBook 5 RelaxNG
    > schema permits elements in the MathML namespace, but it does not try to
    > validate them. But it seems your problem is recognizing the named
    > character entities in the MathML DTD. If Jing does not like loading the
    > entire MathML DTD as you tried, it would probably accept loading just
    > the entity declarations from the DTD. You could try copying the MathML
    > dtd to another file and stripping out all *but* the entity declarations.
    > Those are conveniently located at the end of the DTD file. Then
    > reference that file in the parameter entity in the DOCTYPE to load those
    > entities.
    >
    > Then Jing should validate against the DocBook 5 RNG schema. If you
    > also want to validate the embedded MathML elements, you will need a
    > validator compatible with NVDL such as oNVDL (
    > http://www.oxygenxml.com/onvdl.html ).

    Thanks very much Bob, and Carlos. This is very helpful. If I load
    just the four entity declarations I require, jing validates my DB5
    source without hanging.

    However, I then ran into an issue with the catalog setup. My
    system's XML catalog (which includes whatever the Debian docbook and
    mathml packages I have installed put there) contains the identifiers for
    mathml2.dtd. Loading that also pulls in the co-resident local copies of
    the entity sets I need from

    http://www.w3.org/TR/xml-entity-names/#sets

    But I'm no longer loading mathml2.dtd due to the aforementioned
    problems with jing, and neither the public nor system identifiers
    corresponding to the specific entity sets I require are in my XML
    catalog. So when I try to include them individually in my documents,
    with a doctype prolog such as

    "-//W3C//ENTITIES Added Math Symbols: Delimiters//EN//XML"
    "http://www.w3.org/2003/entities/2007/isoamsc.ent"
    >
    ]>

    they aren't found (unless I allow the processor to fetch them from the
    net, which is of course very slow).

    Short of tweaking the system XML catalog setup, which is not
    something I can expect all of the people who will be using my documents
    to understand or want to do, distributing copies of the entity sets
    bundled with my Docbook source seems like the simplest way forward.

    Would you agree, or am I missing some straightforward way (not
    requiring root access, not OS-specific) to make XML lookups for these
    specific entity sets check in the same place as mathml2.dtd, even
    though their identifiers aren't in the system XML catalog?

    Jon Leech




  • 8.  Re: [docbook-apps] Catalog setup issues in using MathML entity sets (was Re: Should xmllint successfully validate docbook 5 containing XIncludes?)

    Posted 11-04-2013 16:23
    Hi Jon,
    A command line can reference more than one XML catalog, so you could add
    your own catalog for the entities. But if you cannot alter the processing
    command or catalogs, then shipping the entity files and using local
    references will certainly work and be simple enough to debug.

    To simplify the DOCTYPE of your documents, I would suggest creating a single
    system entity file that references all the iso entity files with relative
    file references. That way your DOCTYPE only need to refer to a single file.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net

    --------------------------------------------------
    From: "Jon Leech" <jon@alumni.caltech.edu>
    Sent: Thursday, October 31, 2013 11:28 PM
    To: <docbook-apps@lists.oasis-open.org>
    Subject: [docbook-apps] Catalog setup issues in using MathML entity sets
    (was Re: Should xmllint successfully validate docbook 5 containing
    XIncludes?)

    > On 10/31/2013 09:36 AM, Bob Stayton wrote:
    > > Hi Jon,
    > > I think Carlos meant to use the official MathML namespace instead of a
    > > DTD reference:
    > >
    > > xmlns:mathml="http://www.w3.org/1998/Math/MathML"
    > >
    > > It seems loading the MathML DTD confused Jing. The DocBook 5 RelaxNG
    > > schema permits elements in the MathML namespace, but it does not try to
    > > validate them. But it seems your problem is recognizing the named
    > > character entities in the MathML DTD. If Jing does not like loading the
    > > entire MathML DTD as you tried, it would probably accept loading just
    > > the entity declarations from the DTD. You could try copying the MathML
    > > dtd to another file and stripping out all *but* the entity declarations.
    > > Those are conveniently located at the end of the DTD file. Then
    > > reference that file in the parameter entity in the DOCTYPE to load those
    > > entities.
    > >
    > > Then Jing should validate against the DocBook 5 RNG schema. If you
    > > also want to validate the embedded MathML elements, you will need a
    > > validator compatible with NVDL such as oNVDL (
    > > http://www.oxygenxml.com/onvdl.html ).
    >
    > Thanks very much Bob, and Carlos. This is very helpful. If I load
    > just the four entity declarations I require, jing validates my DB5
    > source without hanging.
    >
    > However, I then ran into an issue with the catalog setup. My
    > system's XML catalog (which includes whatever the Debian docbook and
    > mathml packages I have installed put there) contains the identifiers for
    > mathml2.dtd. Loading that also pulls in the co-resident local copies of
    > the entity sets I need from
    >
    > http://www.w3.org/TR/xml-entity-names/#sets
    >
    > But I'm no longer loading mathml2.dtd due to the aforementioned
    > problems with jing, and neither the public nor system identifiers
    > corresponding to the specific entity sets I require are in my XML
    > catalog. So when I try to include them individually in my documents,
    > with a doctype prolog such as
    >
    > > > "-//W3C//ENTITIES Added Math Symbols: Delimiters//EN//XML"
    > "http://www.w3.org/2003/entities/2007/isoamsc.ent"
    > >
    > ]>
    >
    > they aren't found (unless I allow the processor to fetch them from the
    > net, which is of course very slow).
    >
    > Short of tweaking the system XML catalog setup, which is not
    > something I can expect all of the people who will be using my documents
    > to understand or want to do, distributing copies of the entity sets
    > bundled with my Docbook source seems like the simplest way forward.
    >
    > Would you agree, or am I missing some straightforward way (not
    > requiring root access, not OS-specific) to make XML lookups for these
    > specific entity sets check in the same place as mathml2.dtd, even
    > though their identifiers aren't in the system XML catalog?
    >
    > Jon Leech
    >
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >
    >
    >