Subject: Re: how to check "grammar" of xml using a schema or DTD withelementtree - msg#00005
List: python.xml
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: xml-sig-bounces@xxxxxxxxxx [
mailto:xml-sig-bounces@xxxxxxxxxx] On
Behalf Of Fredrik Lundh
Sent: Thursday, November 16, 2006 6:59 AM
To: xml-sig@xxxxxxxxxx
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 - XML-SIG@xxxxxxxxxx
http://mail.python.org/mailman/listinfo/xml-sig
_______________________________________________
XML-SIG maillist - XML-SIG@xxxxxxxxxx
http://mail.python.org/mailman/listinfo/xml-sig
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Buy Vicodin online today, overnight shipping xyiz kccg v
Dear Sirs can you tell me how i can buy vicodin on line i have thyed to in
the past i have gout in my joints . need this for my pain can you
pleaqse help Mr Darnell Rodriguez
_______________________________________________
XML-SIG maillist - XML-SIG@xxxxxxxxxx
http://mail.python.org/mailman/listinfo/xml-sig
Next Message by Date:
click to view message preview
[ pyxml-Bugs-1598441 ] Fails to print ampersand
Bugs item #1598441, was opened at 2006-11-17 17:16
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=1598441&group_id=6473
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Daniel Aarno (macbishop)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fails to print ampersand
Initial Comment:
I can't figure out how to print a ampersand in a text node. This is probably
not a bug but a feature but it has been giving me a headeach.
### BEGIN CODE ###
Running the following program:
from xml.dom.minidom import *
from xml.dom.ext import *
doc = Document()
n = doc.createElement("aroot")
tn = doc.createTextNode(" ")
n.appendChild(tn)
doc.appendChild(n)
PrettyPrint(doc)
### END CODE ###
I want the output to be
<?xml version='1.0' encoding='UTF-8'?>
<aroot> </aroot>
but the actual output is:
<?xml version='1.0' encoding='UTF-8'?>
<aroot>&nbsp;</aroot>
i.e. the & has been replaced by & which is not what I want.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=1598441&group_id=6473
_______________________________________________
XML-SIG maillist - XML-SIG@xxxxxxxxxx
http://mail.python.org/mailman/listinfo/xml-sig
Previous Message by Thread:
click to view message preview
Buy Vicodin online today, overnight shipping xyiz kccg v
Dear Sirs can you tell me how i can buy vicodin on line i have thyed to in
the past i have gout in my joints . need this for my pain can you
pleaqse help Mr Darnell Rodriguez
_______________________________________________
XML-SIG maillist - XML-SIG@xxxxxxxxxx
http://mail.python.org/mailman/listinfo/xml-sig
Next Message by Thread:
click to view message preview
Re: how to check "grammar" of xml using a schema or DTD withelementtree
On Thu, Nov 16, 2006 at 01:33:46PM -0800,
Margie Levine <margie.levine@xxxxxxx> wrote
a message of 54 lines which said:
> Are the validations tools you use freely available or are these
> things that you've written?
To validate against Relax NG schemas, there are at least two free
programs (the implementation of RelaxNG in 4suite is very limited, I
suggest not using it):
http://www.davidashen.net/rnv.html
xmllint in http://xmlsoft.org/
_______________________________________________
XML-SIG maillist - XML-SIG@xxxxxxxxxx
http://mail.python.org/mailman/listinfo/xml-sig