473,549 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ 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.xml proc import xmlproc
from xml.parsers.xml proc import xmlval
from xml.parsers.xml proc 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 1966
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
3887
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 adresses and so on. I thought it might be a better way to programm an automated, dynamic form validation that works for all kinds of fields, shows the...
7
16250
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 Python 2.2 but can upgrade to 2.3 beta if needed. I am looking for something like: " $ python validate.py myxmlfile.xml mydtd.dtd "
1
1459
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 ASCII? lance Lance Ellinghaus EDS - TWAI Operations Phone: 214-922-5454
1
1820
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. Does anybody know who the current maintainer is (if that changed), or what the status of xmlproc is? We kind of depend on it... The patch fixes a...
2
2393
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 output. Regards, Cees # base imports
2
2136
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 example, using XPath or Java method. So is there a concept and/or standard for post-schema validation or application validation? Is there any hook in XML...
4
2598
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. How can I use both? Thank you, Tim Meagher
14
6275
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) show the error message next to the control. For example, if the text field is empty with RequiredField Validator control, it can show the value in...
6
2404
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
7520
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7450
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7470
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7809
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5368
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1941
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1059
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
763
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.