XML partial validation.

  • Thread starter José Rui Faustino de Sousa
  • Start date
J

José Rui Faustino de Sousa

Hi!

I am writing a text to XML parser that as to be easily extensible (via
new text format plug-ins) and modifiable if the XML format used changes.

Since the text order does not match the XML document order I have to use
a package that allows DOM-like handling of XML (elementtree for
instance).

The XML DTD is still (and most likelly will be) in a state of evolution.

To make life much easier for future developers what I really needed was
some package that implemented something like DOM level 3 XML partial
validation.

There seems to be already something implemented in PyXML (at least the
Validition-Err exception is there) but there is no documentation and I
can not figure how to turn partial validation on.

Any advice?

Thank you very much.

Best regards
José Rui
 
S

Stefan Behnel

José Rui Faustino de Sousa said:
I am writing a text to XML parser that as to be easily extensible (via
new text format plug-ins) and modifiable if the XML format used changes.

Since the text order does not match the XML document order I have to use
a package that allows DOM-like handling of XML (elementtree for
instance).

The XML DTD is still (and most likelly will be) in a state of evolution.

To make life much easier for future developers what I really needed was
some package that implemented something like DOM level 3 XML partial
validation.

There seems to be already something implemented in PyXML (at least the
Validition-Err exception is there) but there is no documentation and I
can not figure how to turn partial validation on.

lxml supports RelaxNG and XMLSchema besides DTDs, you might have more luck
with those, especially since they are XML, so you can work on the schema
documents and extract the sections that are relevant for a specific XML fragment.

lxml is compatible with the ElementTree API, so you can reuse the ET code you
already have.

Stefan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top