Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > docbook and xmlproc

Reply
Thread Tools

docbook and xmlproc

 
 
Tim Arnold
Guest
Posts: n/a
 
      01-22-2008
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


 
Reply With Quote
 
 
 
 
Stefan Behnel
Guest
Posts: n/a
 
      01-23-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DTD validation and xmlproc mmm Python 2 04-24-2008 08:20 PM
DocBook: Pass DocBook-Path to Stylesheet tthunder@gmx.de XML 1 11-27-2007 12:08 AM
xmlproc maintainer? Alban Hertroys Python 1 03-18-2005 07:10 PM
Transform XML docbook to HTML with docbook stylesheet Antonio Amato XML 2 11-18-2004 05:08 PM
xmlproc returning all strings as unicode? Ellinghaus, Lance Python 1 10-10-2003 10:48 PM



Advertisments