Re: how to check "grammar" of xml using a schema or DTD withelementtree

"Margie Levine" <[email protected]>
Newsgroups gmane.comp.python.xml
Message-ID <[email protected]>
Thanks for your response.  Are the validations tools you use freely
available or are these things that you've written?  A separate
validation tool would also work fine for me.

Margie
-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Fredrik Lundh
Sent: Thursday, November 16, 2006 6:59 AM
To: [email protected]
Subject: Re: [XML-SIG] how to check "grammar" of xml using a schema or
DTD withelementtree

Margie Levine wrote:

> Right now I am using elementtree to check this within my program.  IE,
I
> traverse the tree and make sure the xml meets the specifications.
Based
> on my reading, it seems that I can use a DTD or scheme to define the
> "grammar" of my xml, but I can't figure out how to actually set this
up.
> It seems like I should just be able to specify my DTD or Schema and
then
> call ElementTree's parse method and Elementtre should just give me
> errors if the xml doesn't conform to the rules.  Maybe Elementtree
just
> doesn't support this?  I see some doc that says lxml supports
schema's,
> will lxml do this for me?

basic ET only does well-formedness checks; lxml comes with validation
support
for DTD:s, schemas, and Relax NG.

> What are other folks doing to deal with this?

well, I'm using separate validations tools as part of the test suite,
and I'm then
assuming that my code doesn't actually mess itself up when running...

</F> 



_______________________________________________
XML-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/xml-sig



_______________________________________________
XML-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/xml-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.