You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Hilario Perez Corona <hp...@gmail.com> on 2010/10/27 19:14:24 UTC

Detecting the tag/attribute on a validation error

I am using SAX2XMLReader to validate an XML against an XSD.

The problem is that i am receiving an XML in a single line of a text file,
and when the XML is invalid, it can only get that the error is on line 1.
The column is sent with 0 on the ErrHandler::error(const SAXParseException&
err) method.

I want to be able to show the user: The X error was on */Invoice/Item/@price
*.

So far i am unable to do that... I tryed with other methods of
DefaultHandler, but the parser only reports elements that have passed
validations...


Thanx.

-- 
Hilario Perez Corona
"No Religion Higher Than Truth"

Re: Detecting the tag/attribute on a validation error

Posted by Hilario Perez Corona <hp...@gmail.com>.
No suggestions on this?

I think i would need to modify the parser to allow me to show this
information.


On Wed, Oct 27, 2010 at 12:14 PM, Hilario Perez Corona
<hp...@gmail.com>wrote:

> I am using SAX2XMLReader to validate an XML against an XSD.
>
> The problem is that i am receiving an XML in a single line of a text file,
> and when the XML is invalid, it can only get that the error is on line 1.
> The column is sent with 0 on the ErrHandler::error(const SAXParseException&
> err) method.
>
> I want to be able to show the user: The X error was on *
> /Invoice/Item/@price*.
>
> So far i am unable to do that... I tryed with other methods of
> DefaultHandler, but the parser only reports elements that have passed
> validations...
>
>
> Thanx.
>
> --
> Hilario Perez Corona
> "No Religion Higher Than Truth"
>



-- 
Hilario Perez Corona
"No Religion Higher Than Truth"