The class SAXParseException has a method, getSystemId() which can tell
whether the fault occurred in the Schema or the XML document.

On Sun, Feb 22, 2009 at 2:08 PM,  <q3s38w...@sneakemail.com> wrote:
> Hi there,
>
> I'm using Xerces2-J to parse an XML document into a DOM. My application is
> XML Schema aware, and the XML documents that my app is parsing are defined
> via a schema.
> When my application reads the XML document, it installs an ErrorHandler to
> catch parsing errors. However, I noticed that schema validation errors are
> caught by the very same interface (ErrorHandler.error(SAXParseException) and
> friends), so I can't determine if the error was a validation error or a
> parse error. The only possiblity I see to programmatically distinguish
> between the two is to parse the error message string, which hardly seems
> like a good solution to me.
> Is there another interface that I can use that allows me to do some more
> specific error handling?
>
> Cheers,
>
> Uwe



-- 
Regards,
Mukul Gandhi

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-users-h...@xerces.apache.org

Reply via email to