You state that it gives you the element name in the error message
Though this is not always the case.
For example if the element has an attribute and
it is the attribute that is invalid according to the schema
the error message is entirely different.

You may want to consider setting a flag to hold the value of
an element name every time the parser comes across the start
of an element by over-riding the startElement() method from
the ContentHandler interface.

Each time a new  start element is found the flag could then
be made to reference the new start element.

Within the errorHandler you then have access to name of the element
referenced by the flag.

Hope this helps

Dave Flanagan

At 10:21 AM 3/4/02, you wrote:
ohhhh!!!!!!!!!!!! sandy, elena or someone, come for our
rescue!!!!!!!!!!!!!!!!!!!

Ragu
CircuitVision



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 04, 2002 10:14 AM
To: [EMAIL PROTECTED]
Subject: R�f. : Help in validating.



I had the same question and I had no answer... I would appreciate too to get
the name of the element just to get its properties in
the schema to alert the user and to remember to him the characteristics of
the data.




"Ragunath Marudhachalam" <[EMAIL PROTECTED] Pour : <[EMAIL PROTECTED]> ision.com> cc : Objet : Help in validating. 03/04/2002 03:58 PM Veuillez r�pondre � xerces-j-user






Hi All,

I'm using xerces to validate my xml document with schema. I'm setting
ErrorHandler and i;m able to validate. When i get a exception, i'm able to
get the error message and the line number. Even though it gives me the
element name in the error message, is there any way i can get the element
name alone where the error has occured. I mean just like the line number, i
would like to get the element name.

Your help in this is highly appreciated!!!!

Thanks

Ragu
CircuitVision



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to