Accessing XML data in Java

Accessing XML data using Java is very simple if you use the proper API for that purpose. One of the simplest ways of accessing XML data using Java is the use of the Java API for XML Processing (JAXP).


_______________________________________________

You can download the JAXP library from the Sun Microsystems website and install it. Detailed specification is also available for download if you want. Once you have the library in place, you can include the necessary classes in your program code to gain access to the methods used for manipulating the XML file.

Importing org.w3c.dom.Document, org.w3c.dom.DOMException, and org.w3c.dom.Element are necessary to work with the classes and methods that are needed to manipulate the XML files.

Just like you work with the DOM, you have to create the document object to load the XML file that you need to work with. However creating the document object is not straightforward. You have to create a DocumentBuilderFactory and a DocumentBuilder before you create the Document object.

Once you have the document object loaded, you can use the method available in it to manipulate the XML document loaded. Lots of sample code is available in the internet.




_______________________________________________

FREE Subscription

Subscribe to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.

Name:
Email:

Note : We never rent, trade, or sell my email lists to
anyone. We assure that your privacy is respected
and protected.

_______________________________________



 

 

FREE Subscription

Stay Current With the Latest Technology Developments Realted to XML. Signup for Our Newsletter and Receive New Articles Through Email.

Name:

Email:

Note : We never rent, trade, or sell our email lists to anyone. We assure that your privacy is respected and protected.

 

 

Add to My Yahoo!

Visit XML Training Material Guide Homepage

 

 

Copyright - © 2004 - 2017 - All Rights Reserved.