Non validating sax parser
The next stage is to traverse the tree and print the contents.
a) Construction of DOM tree b) Traversing the DOM tree It does a Depth First Pre Order Traversal , for more on tree traversal techniques see here As it goes through each node it prints it contents.
Your code looks as if you'd still be using XMLUnit 1.x. I tried bumping to xmlunit-matchers 2.3.0, since I generally do prefer matchers, but it seems like the API is a little bit too different to just switch over, so initially I am moving it to xmlunit-legacy 2.3.0. Maybe there is a way to have the best of both worlds.This DTD file defines all elements to keep in the xml file.After creating these, we parse the xml file using the parse() method and generates a Document object tree.A DTD defines a set of rules for the allowable tags and attributes in an XML document, and the order and cardinality of the tags.
Programs using the DTD must still agree on what the tags mean (semantics again), but a DTD defines the words (or, the tags) and the grammatical rules for a particular XML dialect.The set Error Handler() method invokes an object of Doucment Builder.