469,600 Members | 2,246 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,600 developers. It's quick & easy.

Validate XML against DTD and/or XML Schema?

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
Apr 16 '06 #1
2 2864
Jim
For DTD's: have you stumbled across:

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

?

Jim

Apr 16 '06 #2
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.

Apr 17 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by QuantDev | last post: by
5 posts views Thread by Doru Roman | last post: by
1 post views Thread by JoeZ | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.