Re: reporting the parsing stack on validation error ?

2007-05-15 Thread fikin

that part seems achievable.

how and where do i hook up with XNI?

as far as i saw it, with SAX seems inappropriate as the SAX-callback comes
after the call to error handler (which prevents me from building the
elements stack prior to error reporting).

On 5/14/07, Michael Glavassevich [EMAIL PROTECTED] wrote:


Hi,

Xerces has nothing built-in which does this. You would have to build the
expression yourself from the SAX (or internal XNI) events and then hook in
your own extension to XMLErrorReporter [1] which replaces the replacement
arguments for each of the error messages with your own.

Thanks.

[1]

http://xerces.apache.org/xerces2-j/javadocs/xerces2/org/apache/xerces/impl/XMLErrorReporter.html

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

fikin [EMAIL PROTECTED] wrote on 05/14/2007 07:48:37 AM:

 i have an use case where the validation error message should contain
 the parsing stack as well.
 for example, instead of:
  org.xml.sax.SAXParseException: cvc-complex-type.3.2.2:
 Attribute 've1r' is not allowed to appear in element 'in:document'.
 to print actually:
  org.xml.sax.SAXParseException: cvc-complex-type.3.2.2:
  Attribute 've1r' is not allowed to appear in element '/in:
 root/in:document '.

 any suggestions?


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




Re: reporting the parsing stack on validation error ?

2007-05-14 Thread Michael Glavassevich
Hi,

Xerces has nothing built-in which does this. You would have to build the 
expression yourself from the SAX (or internal XNI) events and then hook in 
your own extension to XMLErrorReporter [1] which replaces the replacement 
arguments for each of the error messages with your own.

Thanks.

[1] 
http://xerces.apache.org/xerces2-j/javadocs/xerces2/org/apache/xerces/impl/XMLErrorReporter.html

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

fikin [EMAIL PROTECTED] wrote on 05/14/2007 07:48:37 AM:

 i have an use case where the validation error message should contain
 the parsing stack as well.
 for example, instead of:
  org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: 
 Attribute 've1r' is not allowed to appear in element 'in:document'. 
 to print actually:
  org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: 
  Attribute 've1r' is not allowed to appear in element '/in:
 root/in:document '.
 
 any suggestions?


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