Code example for SAXParseException

Methods: getColumnNumber, getLineNumber, getMessage, getSystemId

0
 */ 
public class XMLException implements ErrorHandler {
 
	private String xmlTextException(SAXParseException e) {
		String exception = "";
		exception = e.getSystemId() + "\n" + "row: " + e.getLineNumber() + "\n"
				+ "column: " + e.getColumnNumber() + "\n" + "row: " + e.getMessage();
		return exception;
	} 
 
	@Override 
	public void error(SAXParseException e) throws SAXException {
		System.out.println("XML Error\n" + xmlTextException(e));
 
	} 
 
	@Override 
	public void fatalError(SAXParseException e) throws SAXException {
		System.out.println("XML FatalError\n" + xmlTextException(e));
 
	}