By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,957 Members | 2,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,957 IT Pros & Developers. It's quick & easy.

Recommended validating XML parser?

P: n/a
We're looking for a current, supported, validating XML parser. Since it
seems like there are a few thousand out there, I though we'd see what
everyone else is using.

Bonus points if it can do something like:
>>foo = XMLParser("""
<xml>
<weight>3000</weight>
</xml>
""", dtd=file('/etc/weightfile.dtd'))
>>print foo.weight
3000

....or some variant on that theme.
--
Kirk Strauser
May 7 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Kirk Strauser wrote:
We're looking for a current, supported, validating XML parser. Since it
seems like there are a few thousand out there, I though we'd see what
everyone else is using.
You are asking for lxml, right?

http://codespeak.net/lxml/

Bonus points if it can do something like:
>>foo = XMLParser("""
<xml>
<weight>3000</weight>
</xml>
""", dtd=file('/etc/weightfile.dtd'))
>>print foo.weight
3000

...or some variant on that theme.
Not currently supported, only document internal DTD references are used. But
you can always validate the document *after* parsing, be it with DTD,
XMLSchema or RNG.

BTW, adding this would be straight forward. The implementation is there, it's
just not available at the API level (and I'm not sure enough how it should
look like...)

Stefan
May 7 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.