lxml and schema validation

hrishy hrishys at yahoo.co.uk
Fri Oct 3 07:27:56 EDT 2008


Hi

I am validating a xmlfile against a xsd (My.xsd) but i notice that the xsd has a include which includes another xsd (My1.xsd)

I have written a simple program that to validate this

from lxml import etree
xmlschemadoc=etree.parse("My.xsd")
xmlschema=etree.XMLSchema(xmlschemadoc)
xmldoc=etree.parse("My.XML")
xmlschema.assertValid(xmldoc)

will my program validate against My.xsd and My1.xsd both ?

I also would like my program to continue validation against the xsd and not stope at the first failure .
my question would be how do i do that in python ?

regards
Hrishy


      



More information about the Python-list mailing list