473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Recommended validating XML parser?

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
1 1084
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: jmb | last post by:
Can anyone help me out. I have a set of xml documents and a dtd which is not refered to in the xml documents themselves. I've written the code to check that the xml is well formatted using...
2
by: Benjamin Niemann | last post by:
Hi, does anyone know of a validating SGML parser in python (like xmlproc.xmlval does for XML)? Goal is to validation HTML against the DTD, similar to validator.w3.org, not all SGML obscurities...
2
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...
0
by: Yona | last post by:
Im trying to validate an xml file using the xercesDomParser, but it seems like it doesnt validate the xml file. I get an error only if the schema isnt valid. the code is: DOMTreeErrorReporter...
2
by: Cigdem | last post by:
Hello, I am trying to parse the XML files that the user selects(XML files are on anoher OS400 system called "wkdis3"). But i am permenantly getting that error: Directory0: \\wkdis3\ROOT\home...
0
by: jean-gert nesselbosch | last post by:
hello everybody, does anybody know of standardization efforts concerning the output of w3cSchema/relaxNG-validating parsers ? I use libxml2 for validation-purposes (w3c-Schema and relaxNG) and...
2
by: srujana | last post by:
Hi I am validating an xml document against schema . when i am passing the xml file location as an input to the parse method String XmlDocumentUrl="E:/books.xml"; parser.parse(XmlDocumentUrl);...
1
by: dees | last post by:
Hi All, i m using the following code for validation but it terminates with this message--- "terminate called after throwing an instance of 'xercesc_2_7::DOMException' Aborted" #include...
2
by: tarunprabhu | last post by:
Hi, I am using Xerces 2.8. When I try to validate a file which is in the same folder as the xsd, it works fine. But if I try to validate an XML file which is in some other folder, it gives me...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.