Non validating dom parser
The first step we should do is to learn how to parse and print a simple XML document using both DOM and SAX.This will help you to get the basic concepts in parsing and how does DOM API differ from SAX.A non validating parser doesn't validate the XML file against a DTD or XML Schema.Both Validating and non validating parser checks for the well formed ness of the xml document.When a Sax parser parses a XML document and every time it encounters a tag it calls the corresponding tag handler methods when it encounter a Start Tag it calls this method public void start Element(String name, Attribute List attrs) when it encounter a End Tag it calls this method public void end Element(String name) This program also parses a XML file and prints it on the console . In this example, the Print Using Sax Class extends the Handler Base class and implemets the call back methods to handle the printing The steps involved are Get a instance of SAX parser, The previous program illustrated how to Parse an existing XML file using both SAX and DOM Parsers.But generating a XML file from scratch is a different story , for instance you might like to generate a xml file for the data extracted form the database.The Document holds the data as a tree of Nodes, where a Node is a base type that can be an element, an attribute, or some other type of content. Nodes represent a single piece of data in the tree, and provide all of the popular tree operations.
This snippet explains how to handle the element Node parses a XML document and prints it on the console.
Initial parenthesized comments typically come from the test harness.
Some such comments indicate the reporting category defined in the XML specification.
Mapping is the way of transforming one XML structure to another XML Structure bsed on the Business rules. But in case of graphical mapping XI/PI converts the mapping program into executable Java code internally based on graphical design and executes it on J2ee engine making it comparatively less efficiency.
As a part of it we do certain operations like breaking child nodes and attaching them to its parent node and more in an XML structure. Java mappings are more useful when performance of integration server is concerned during runtime.