This parses the file, and then prints the document out
using DOM.
System.out.println("Parsing XML File: " + uri + "\n\n");
// Instantiate your vendor's DOM parser implementation
DOMParser parser = new DOMParser();
try {
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setFeature("http://xml.org/sax/features/namespaces", false);
parser.parse(uri);
Document doc = parser.getDocument();
// Print the document from the DOM tree and
// feed it an initial indentation of nothing
printNode(doc, "");
} catch (Exception e) {
e.printStackTrace();
System.out.println("Error in parsing: " + e.getMessage());
}