[Tutor] XSV validating XML with a schema

Ertl, John John.Ertl at fnmoc.navy.mil
Fri Jun 18 17:50:17 EDT 2004


I have been putting off the schema portion of a web service long enough so I
wrote a schema for the XML that I produce.  Now I need to validate it.  The
idea is this will also let me know if my schema is OK.

I loaded XSV and all of the other files.

I used the following code.

from XSV.driver import runit
import sys

xmlfile         = "tmdXML.xml"
schemafile      = "tmdschema.xsd"

res = runit(xmlfile, [schemafile])

#res[0].printme(sys.stdout) ######  this line always gives me an error
                                          ######  Traceback (most recent
call last):
                                          ######  File "./tmdXSV.py", line
11, in ?
                                          ######  res[0].printme(sys.stdout)
                                          ###### TypeError: printme() takes
at least 4 arguments (2 given)

print res

The output I get is:
(<XSV.infoset.XMLInfoset.Element instance at 0x4067d90c>, None, [],
<XSV.compile.SSchema.SSchema instance at 0x40433ecc>)

What does this mean?  I could not find documentation anywhere. 

Is XSV the best way to go?

Thanks.

John Ertl



More information about the Tutor mailing list