Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   DTD validation and xmlproc (http://www.velocityreviews.com/forums/t612827-dtd-validation-and-xmlproc.html)

mmm 04-23-2008 03:15 PM

DTD validation and xmlproc
 
I found Python code to validate a XML document basd on DTD file
layout. The code uses the 'xmlproc' package and these module loading
steps

from xml.parsers.xmlproc import xmlproc
from xml.parsers.xmlproc import xmlval
from xml.parsers.xmlproc import xmldtd

Unfortunately, the xml package no longer seems to hold the xmlproc
module. As a standalone the xmlproc module seems to be no longer
maintained and was subsumed in PyXML a few years ago and that package
is no longer maintained (as best I can tell, or maybe was subsumed in
the base Python 2.x packages)

My problem is I can not get the old xmlproc package files that i did
find to work with Python 2.5.
I am willing to learn and use new xml procedures, but I found nothng
pre-written to validate agaisnt a given DTD file.

Any advice would be welcome, even a good tutorial on XML validation
usiog Python.

Stefan Behnel 04-23-2008 06:50 PM

Re: DTD validation and xmlproc
 
mmm wrote:
> I am willing to learn and use new xml procedures, but I found nothng
> pre-written to validate agaisnt a given DTD file.
>
> Any advice would be welcome, even a good tutorial on XML validation
> usiog Python.


Regarding that part, try lxml.

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

Stefan

mmm 04-24-2008 08:20 PM

Re: DTD validation and xmlproc
 

> Regarding ... try lxml.
> http://codespeak.net/lxmlhttp://code...alidation.html
>


Thx Stefan, it seems that lxml does everything I need. I have not
figured out all of the bells and whistles but the tutorials are
getting me up to speed. Based 2 days of trial, I can recommend lxml
without reservation.



All times are GMT. The time now is 12:03 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57