You need to supply your own ErrorHandler to the XML parser. This means you will need to create the XML parser (class XMLReader) yourself, which you can then include in a SAXSource that is supplied as the input to your transformation.

Michael Kay
Saxonica

On 05/08/2011 15:16, Kunal Chauhan wrote:
Hello,
 
I am using saxon9he as an XML Processor.
Whenever I try to parse an Invalid XML file at that time, On console I am able to get line number and column number where an error exist within document.
 
But I want to catch that exception and want to print line number and column number where an error exist.
 
 
for example,
On console it gives following output
 

Error on line 3 column 7

SXXP0003: Error reported by XML parser: Element type "aba" must be followed by either

attribute specifications, ">" or "/>".

 

I want this line and column number to show proper error message.

How can I achieve this ?
 

Regards,
--
Kunal Chauhan
mail4ck@gmail.com
[+918655517141]
[+919904983614]

------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA The must-attend event for mobile developers. Connect with experts. Get tools for creating Super Apps. See the latest technologies. Sessions, hands-on labs, demos & much more. Register early & save! http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help