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 

 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 


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

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,



Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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