You can
use Java API for XML Processing (JAXP) for processing the XML document
using your java code. This API has all the classes needed to work with
XML documents. It has all the necessary methods and properties for manipulating
the XML documents.
_______________________________________________
For those who have worked with other scripting languages and programming
languages to manipulate the XML documents, using the java code and the
JAXP would be easy. The logic is the same but only the methods and properties
might vary. Basic knowledge of object oriented programming would help
you though.
To read
the XML document from java code, you need a document object first. This
is created in three steps using the JAXP. First a DocumentBuilderFactory
is created and then a DocumentBuilder is created. Then finally a Document
object is created.
The XML
file is loaded into it and then certain methods like getElementsByTagName()
are used to retrieve all the elements of a particular name and store
them in an array called NodeList. This NodeList is looped through using
a 'for' loop or some other way to get all the values needed.