[XML-SIG] Re: how to use XSV in python to validate an xml file against an xsd schema file

Nico Grubert nicogrubert@web.de
Mon, 31 Mar 2003 13:52:09 +0200


hello henry,

thank you for your posting.

Unfortunately, I do not know exactly what I have to do with the line "  res[0].printme(sys.stdout)  " you mentioned in your posting.


What I am trying is:
 - run the 'validateTestXML.py' to validate "myxmlfile.xml" against  the "myxsdfile.xsd" XSD schema file
- write the result into a variable 'res' to see, if error(s) ocurred or not


What's wrong in my short script below ( 'validateTestXML.py' )? 
 - Is it right, that I call the method 'runitAndShow()' to to validate "myxmlfile.xml" against  the "myxsdfile.xsd" XSD schema file ?
- How do I get a result if the validation returned errors or not ?


-nico

> hello,
> 
> i played around with XSV. I have installed it on win2000 and run the XSV file from the command line passing an xml file and and xsd schema file.
> 
> how can i use XSV in python ?
> 
> I tried:
> 
> """
> # validateTestXML.py
> 
> from XSV.driver import runitAndShow
> 
> xmlfile     = "myxmlfile.xml"
> schemafile  = "myxsdfile.xsd"
> 
> res = runitAndShow( xmlfile, schemafile )
> print res
> 
> """
> 
> but python does not print out anything. how can I print, if the validation brought errors or not ?
> 
> has anybody ever used it directly in python ?
> 
> 
> 
> thanks in advance
> 
> -nico

#############################################

> ht@cogsci.ed.ac.uk (Henry S. Thompson) writes:
>
> <snip/>
>
> > res.printme(sys.stdout)
>
> That should have been
>
> res[0].printme(sys.stdout)
>
> ht
> --

______________________________________________________________________________
Finger wund tippen beim SMS Schreiben? Schluss damit! 
Web.de FreeMail - http://freemail.web.de/features/?mc=021148