Re: [xml] accessing Parser-Ctxt in SAX based schema validation



On Thu, Apr 10, 2008 at 10:37:29AM +0200, Holger Kaelberer wrote:
Hi Daniel.


Daniel Veillard wrote:

But what do I set my state->ctxt  to (supposed to be a xmlParserCtxtPtr) 
as I don't have the parser-Ctxt of the parsed xml-file? I first thought 
of passing the xmlSchemaValidCtxtPtr and than using vctxt->parserCtxt in 
my SAX-handler, but that does not work as the parserCtxt-element is not 
"public".
   

 Hum, right one would need to add an accessor function at the end of
xmlschemas.c ... 

Ok, the attached patch does the job.

But what are you using the parser context for, i'm curious ?
 

So far only for accessing line numbers in the parsed xml-file, when 

  okay

Is there any other way for accessing line numbers in the parsed xml? If 
no, any chance to get the patch included in the distribution?

  getting the global xmlError, i would assume it get updated
    http://xmlsoft.org/html/libxml-xmlerror.html#xmlGetLastError


Patch makes some sense, except inlining a public function and not checking
the input parameter. Took a bit longer to push than expected du to some 
documentation extraction problems, now fixed...

commited in revision 3738,

 thanks,

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]