473,484 Members | 1,596 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DTD validation and xmlproc

mmm
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.
Jun 27 '08 #1
2 1964
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
Jun 27 '08 #2
mmm
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.

Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
3876
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
7
16239
by: Will Stuyvesant | last post by:
Can you give a commandline example how to do XML Validation (checking against a DTD) with Python? Not with 4Suite or other 3rd party libraries, just the Python standard distribution. I have...
1
1449
by: Ellinghaus, Lance | last post by:
Is there a way to make xmlproc not return all strings as unicode? I am passing in standard ASCII and it returns all data as unicode... Or is there an easy way to convert unicode to standard...
1
1813
by: Alban Hertroys | last post by:
Hello all, We recently (about a week ago) sent a patch to the maintainer of xmlproc, but we didn't receive a reply yet. A look at the site reveals that the last update was somewhere in 2000. ...
2
2382
by: Cees Wesseling | last post by:
Hi, it seems that xmlproc, the default Validating parser, in my setup does not call back to setDocumentLocator. Is there anyway to get a locator in my handler? Below you find an example and its...
2
2130
by: wumingshi | last post by:
Hi, When validating an XML instance, sometimes the schema is not enough to expression the validation rules. Additional validation rules may be expressed in an application-specific way. For...
4
2585
by: Tim Meagher | last post by:
I am trying to use both validation controls and to add submit button attributes, but when I add the button attributes, the javascript fpr the validation controls is no longer created for the page. ...
14
6266
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2)...
6
2395
by: Stephen | last post by:
Hi, the validation controls dont work on Netscape or Mozilla and only on Internet Explorer why? How do i correct this problem? Thanks
0
6953
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7105
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7144
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7214
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4845
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4529
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3041
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
235
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.