Re: [xml] Get xpath during schema validation error using libxml2



On Thu, Jan 19, 2012 at 06:39:15PM -0800, ajay bhadauria wrote:
Hi all,

I need help in finding the element xpath where schema validation fails. Is there any libxml2 API which 
could be used to get the xpath of an element in the document which fails schema validation.

Any help or direction is appriciated.

  Register a structured error handler. Then I think you will usually
get an xmlNodePtr as part oif XSD errors and you can use
xmlGetNodePath() to get an XPath for the node. That won't work however
when streaming XSD as no tree is been built

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



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