Hi,

 

In Python, I need to validate a DOM tree using a W3C XML schema, but I cannot figure out how to do it. 
 
It seems that the C-function  xmlSchemaValidateDoc does the job but  I’m lost in the Python binding.
 
 
( My (naïve) trials were in the style:
  schemadoc = libxml2.parseFile("my-schema.wxs")
  schema = libxml2.Schema(schemadoc)
  ctxt = libxml2.SchemaValidCtxt(schema)
  #ctxt.schemaParse() ??
  doc = libxml2.parseFile("test.xml")
   res = doc.schemaValidateDoc(ctxt)
)
 
Is there anyone around that can show me the way? (I insist, that it is about validating a DOM already in memory)
 
Thanks,
 
JL

 

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to