Re: [xml] Getting line number of schema validation errors
- From: Daniel Veillard <veillard redhat com>
- To: Israel Ganor <ganor softlink com>
- Cc: "'xml gnome org'" <xml gnome org>
- Subject: Re: [xml] Getting line number of schema validation errors
- Date: Sun, 16 May 2004 15:10:40 -0400
On Sun, May 16, 2004 at 10:58:30AM +0200, Israel Ganor wrote:
Hi,
I validate XML files vs. a schema asfollows:
xmlSchemaSetValidErrors(validSchema,
(xmlSchemaValidityErrorFunc) ErrorCallback,
(xmlSchemaValidityWarningFunc) WarningCallback,
NULL);
xmlSchemaValidateDoc(validSchema, pDoc);
However, in ErrorCallback and WarningCallback I only get general info about
the failure, but without the line number.
It it's very helpful to tell the user that there is an error in <USER>
element, when his XML file contains 100 such elements.
Is there a way to tell the exact error line number?
Obviously not with that API. Use the xmlSetStructuredErrorFunc()
from xmlerror.h to register a global structure error handler, then
you should get the node where the error was generated.
Daniel
--
Daniel Veillard | Red Hat Desktop team http://redhat.com/
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]