Parsing
XML file using Java is easy if you are using the Java API for XML (JAXP)
processing. You can download the JAXP from the Sun Microsystems website.
You can also find the specifications of JAXP in the same website.
_______________________________________________
_______________________________________________
A sample
line of code that would parse the XML fine into a document object is
given below.
Document
doc = dbuild.parse(new File("xmlfile.xml"));
In the
above line 'doc' is the document object that is used to load the XML
document that you want to work with. 'dbuild' is the DocumentBuilder
object. Before you create a 'doc' object you need to create a DocumentBuilderFactory
and then a DocumentBuilder.
Once the
XML document is loaded into the document object, you can use the methods
available to manipulate the elements of the XML document. For example
to get all the elements of a particular tag name you would using the
method getElementsByTagName() method of the document object.
Similarly
methods to change and remove elements and to create attributes are also
available. You can find lots of code samples for XML processing the
Sun Microsystems website.
Google open-sources XML-alternative Protocol Buffers (CNET via Yahoo! News)
XML, it seems, has run out of steam for Google.
Google open sources XML alternative Protocol Buffers (ZDNet Asia)
Software company releases software for encode data in multiple formats in a single binary format for network communications or storage.
Google open-sources XML-alternative Protocol Buffers (CNET)
Company releases software for encoding data in multiple formats in a single binary format for network communications or storage.