C
Cengiz
Hi,
i have to parse an xml-file.
I do this with JDOM:
File file = new File("test.xml");
SAXBuilder builder = new SAXBuilder(true);
builder.setFeature("http://apache.org/xml/features/validation/schema", true);
Document document = builder.build(file);
Element rootElement = document.getRootElement();
Now i have the root-element and i can hangle through the document.
But how i can get the line number information for a special element.
For example: Element child = rootElement.getChild("ChildElement");
Corresponding XML-File:
<TEST>
<ChildElement attr="..."/>
...
</TEST>
ChildElement is at line 2.
How to get this information ?
thx, Cengiz
i have to parse an xml-file.
I do this with JDOM:
File file = new File("test.xml");
SAXBuilder builder = new SAXBuilder(true);
builder.setFeature("http://apache.org/xml/features/validation/schema", true);
Document document = builder.build(file);
Element rootElement = document.getRootElement();
Now i have the root-element and i can hangle through the document.
But how i can get the line number information for a special element.
For example: Element child = rootElement.getChild("ChildElement");
Corresponding XML-File:
<TEST>
<ChildElement attr="..."/>
...
</TEST>
ChildElement is at line 2.
How to get this information ?
thx, Cengiz