Example usage for org.jdom2.input JDOMParseException getLineNumber

List of usage examples for org.jdom2.input JDOMParseException getLineNumber

Introduction

In this page you can find the example usage for org.jdom2.input JDOMParseException getLineNumber.

Prototype

public int getLineNumber() 

Source Link

Document

Returns the line number of the end of the text where the parse error occurred.

Usage

From source file:mx.com.pixup.portal.demo.ValidateXSDXMLCancion.java

public static void main(String[] args) throws IOException, JDOMException {

    try {//w  w  w.j av a2  s  .c om
        //Create the XMLReaderJDOMFacotory directly using the schema file instead of 'Schema'
        String schemaFile = "";
        String file = "";

        XMLReaderJDOMFactory factory2 = new XMLReaderXSDFactory(schemaFile);
        SAXBuilder sb2 = new SAXBuilder(factory2);
        Document doc2 = sb2.build(new File(file));
        System.out.println("ok");
        System.out.println(doc2.getRootElement().getName());
    } catch (org.jdom2.input.JDOMParseException e) {
        e.getLineNumber();
        System.out.println("error");
    }
}