blob: e1eb1aa0d7feee5177b8e8bbdca8f0203ab62219 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import java.io.File;
import org.xml.sax.SAXException;
public class Main {
public static void main(String[] argv) {
File xmlReport = new File(argv[0]);
SAXReader saxReader = new SAXReader();
try {
XMLTolerantErrorHandler.attach(saxReader, true);
} catch (SAXException ex) {
ex.printStackTrace();
}
Document result;
try {
result = saxReader.read(xmlReport);
} catch (DocumentException ex) {
ex.printStackTrace();
return;
}
Element root = result.getRootElement();
System.out.println("ROOT: "+root);
}
}
|