Processing
XML with Java has different approaches like SAX and DOM. In the SAX
the XML document is searched from the beginning and is passed to the
application in sequence. Here the document is not stored in memory.
_______________________________________________
In-memory
manipulation is not there in the SAX approach. In the DOM approach the
document is held in the memory and is manipulated in the memory and
then stored.
Now there
is another Java API to work with XML and it is called the Java Architecture
for XML Binding (JAXB). In this approach the schema is bound to the
XML document and the document is un-marshaled into Java content objects.
These content
objects are easily available to the program and the user need not know
about XML or XML processing to work with these content objects in JAXB.
There is no need to user parsers and content handlers to work with XML
document using JAXB.
The XML
document is presented to the program in Java format i.e. classes are
created to represent the schema and the XML document. These classes
are then used to manipulate the XML document without the need to know
about XML or XML processing.