Do you
want to parse the XML documents using Java programming? Then you can
use Java API for this purpose. By using the Java API you can write code
that can manipulate the XML documents as you wish. It is easy to use
this. You can download the Java API from the Sun Microsystems website.
_______________________________________________
_______________________________________________
Detailed
documentation is also available for download from them. You can refer
to the documentation for more details on the classes available and the
methods available to manipulate XML document.
Importing
proper packages and classes is necessary if you want to work with the
Java API to handle the XML files. Your import statement would include
the following,
import
org.w3c.dom.Document;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
Once you
have imported these you can start creating a document object in three
steps to load the XML document that you want to manipulate. A sample
code to load the XML document in the document object is shown below:
DocumentBuilder
db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = db.parse(new File("XML_file.xml"));
Instead
of creating the DocumentBuilder object in a single line of code as given
above you can first create a DocumentBuilderFactory object and then
from that you can create the DocumentBuilder.
The document
has lots of methods to work with XML document. For example you might
use the getElementsByTagName() method to get all the elements by a node
name.
What Is the Problem with JavaME? (Developer.com)
This section is interesting only for programmers who never have developed a JavaME application, because every JavaME developer has encountered the same pitfalls when trying to make an appealing user interface.