docbook-apps

  • 1.  Cannot use entity (reference to file) in parameter file - DocBook 5

    Posted 04-05-2008 13:49
    Hello all,

    Consider the following DocBook 5 files:

    test.xml
    ========


    %testent;
    ]>
    <book xmlns="http://docbook.org/ns/docbook" version="5.0">

    <info>

    <subtitle><orgname>&company;</orgname></subtitle>
    <author>
    <personname>
    <firstname>John</firstname><surname>Brown</surname>
    </personname>
    </author>
    <copyright>
    <year>2008</year><holder>&company;</holder>
    </copyright>
    </info>

    &test1;



    </book>


    test.ent
    ========



    test1.xml
    =========
    <chapter>
    <para>OK</para>
    </chapter>

    When I run 'xmllint --noout --relaxng /path/to/docbook.rng test.xml',
    it returns:
    test.xml:1: element chapter: Relax-NG validity error : Did not expect element
    chapter there
    test.xml:1: element chapter: Relax-NG validity error : Element book failed to
    validate content
    test.xml fails to validate

    If I comment out "&test1;" and uncomment the chapter definition, then
    test.xml validates.

    What am I doing wrong?




  • 2.  Re: [docbook-apps] Cannot use entity (reference to file) in parameter file - DocBook 5

    Posted 04-05-2008 14:08
    Hello John,

    On Samstag, 5. April 2008, John Brown wrote:
    > [...]
    > When I run 'xmllint --noout --relaxng /path/to/docbook.rng test.xml',
    > it returns:
    > test.xml:1: element chapter: Relax-NG validity error : Did not expect
    > element chapter there
    > test.xml:1: element chapter: Relax-NG validity error : Element book
    > failed to validate content
    > test.xml fails to validate
    >
    > If I comment out "&test1;" and uncomment the chapter definition, then
    > test.xml validates.
    >
    > What am I doing wrong?

    Unfortunately, I experienced also some problems with xmllint in regard to
    DocBook5 validation. I would suggest to try another validator, for
    example jing or msv. See the following link for more information:

    http://www.docbook.org/docs/howto/#validators

    By the way: You can also use XInclude instead of external entities. This
    technique is also described in the above document.


    Tom

    --
    Thomas Schraitle