docbook and xmlproc

Discussion in 'Python' started by Tim Arnold, Jan 22, 2008.

  1. Tim Arnold

    Tim Arnold Guest

    hi, I'm unable to get xmlproc to validate my docbook test file. This is new
    territory for me, so I'd appreciate any advice on what I'm doing wrong.
    Using python 2.4 on HPux10.20.

    The test file (testdb.xml)
    <?xml version="1.0"?>
    <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
    "/dept/app/doc/xml/DocBook/docbookx.dtd">
    <chapter><title>Test Chapter</title>
    <para>
    This is a test document.
    </para>
    </chapter>

    The python code:
    from xml.parsers.xmlproc import xmlproc
    from xml.parsers.xmlproc import xmlval
    print 'Validate without DTD'
    p0 = xmlproc.XMLProcessor()
    p0.set_application(xmlproc.Application())
    p0.parse_resource('testdb.xml')
    print
    #
    print 'Validate with DTD'
    p1 = xmlval.XMLValidator()
    p1.set_application(xmlval.Application())
    p1.parse_resource('testdb.xml')

    Of course it gets through the 'Validate without DTD' portion fine, but I get
    this error on the 'Validate with DTD' part:
    -----------------------
    ERROR: Internal error: External PE references not allowed in declarations at
    /dept/app/doc/xml/DocBook/dbcentx.mod:308:10
    TEXT: '
    ]]>

    <![ '
    -----------------------
    The DTD I'm using is the plain-vanilla docboox.dtd version 4.5, downloaded
    from the docbook.org site. My guess is that I'm misunderstanding something
    in the above code, but for completeness, here's the info on the dbcentx.mod
    file: the file has this def at the beginning:

    <!ENTITY % ISOamsa.module "INCLUDE">
    <![%ISOamsa.module;[
    <!ENTITY % ISOamsa PUBLIC
    "ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
    "ent/isoamsa.ent">
    <!--end of ISOamsa.module-->]]>

    and these lines later on (307-9) :
    307 <![ %ISOamsa.module; [
    308 %ISOamsa;
    309 ]]>

    The isoamsa.ent file is in the ent subdir relative to the dbcentx.mod file,
    so I'm at a loss.
    thanks,
    --Tim Arnold
     
    Tim Arnold, Jan 22, 2008
    #1
    1. Advertising

  2. Tim Arnold wrote:
    > I'm unable to get xmlproc to validate my docbook test file. This is new
    > territory for me, so I'd appreciate any advice on what I'm doing wrong.
    > Using python 2.4 on HPux10.20.


    I do not have much experience with xmlproc, but I'd encourage you to use lxml,
    which uses the parser and DTD validator of libxml2.

    http://codespeak.net/lxml/dev/
    http://codespeak.net/lxml/dev/validation.html

    Stefan
     
    Stefan Behnel, Jan 23, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Antonio Amato
    Replies:
    2
    Views:
    1,286
    Michael Wiedmann
    Nov 18, 2004
  2. Ellinghaus, Lance

    xmlproc returning all strings as unicode?

    Ellinghaus, Lance, Oct 10, 2003, in forum: Python
    Replies:
    1
    Views:
    273
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Oct 10, 2003
  3. Alban Hertroys

    xmlproc maintainer?

    Alban Hertroys, Mar 18, 2005, in forum: Python
    Replies:
    1
    Views:
    325
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Mar 18, 2005
  4. Replies:
    1
    Views:
    528
    Joseph Kesselman
    Nov 27, 2007
  5. mmm

    DTD validation and xmlproc

    mmm, Apr 23, 2008, in forum: Python
    Replies:
    2
    Views:
    514
Loading...

Share This Page