Hi,

On Tue, 2005-10-25 at 17:14 +0200, Meunier, Jean-Luc wrote:
> 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

I'm heading home, so just a short one: maybe the test suite
file "xstc/xstc.py" can be of some help; it uses schemaValidateDoc()
as well as schemaValidateFile() for stream-based validation.

Regards,

Kasimier


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

Reply via email to