Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Validate XML against DTD and/or XML Schema?

Reply
Thread Tools

Validate XML against DTD and/or XML Schema?

 
 
Reid Priedhorsky
Guest
Posts: n/a
 
      04-16-2006
Hi folks,

I have a need to validate XML files against both DTDs and XML Schema from
the command line.

In an ideal world, I'd be able to do something like:

$ python validate.py foo.xml

which would then parse and validate foo.xml using the schema or DTD
referenced within it.

What I'm looking for is the contents of validate.py. A Python solution
isn't essential, but I like Python and I'm doing some other light XML
stuff in Python, so I'd prefer it.

I did some Googling, but I'm a little overwhelmed by the quantity and
variety of stuff I found, and I found a lot of stuff that was out of date.
I thought it would be useful to ask here.

Let me know if you have any questions, and thanks very much for any help.

Reid
 
Reply With Quote
 
 
 
 
Jim
Guest
Posts: n/a
 
      04-16-2006
For DTD's: have you stumbled across:

http://aspn.activestate.com/ASPN/Coo.../Recipe/220472

?

Jim

 
Reply With Quote
 
 
 
 
Ravi Teja
Guest
Posts: n/a
 
      04-17-2006
http://xmlstar.sourceforge.net/
Not Python, but just the tool for the job.

For Python, 4Suite has some validators. But parts of it were written in
C and might not be helpful if you want to look at the Python source
code. You might want to check
http://www.leuthe.homepage.t-online...._overview.html
for a pure Python sample. The page says it is not complete though.

 
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
Validate XML against DTD? XSD OK. SSCCE. Andrew Thompson Java 5 10-04-2007 10:54 AM
Possible to validate XML against a DTD using Java 5/JAXB/etc? techguy_chicago@yahoo.com Java 0 06-20-2006 12:37 AM
Validating XML against a DTD that is not supplied in the XML Schema Ben Jessel Java 0 08-05-2004 11:45 AM
libxml, how to validate against a given dtd? Adib Taraben XML 1 05-24-2004 04:30 AM
Validate S-expression against a DTD or equivalent? Robert Dodier XML 3 11-04-2003 10:07 AM



Advertisments
 



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