|
Understanding
Java API for XML processing (JAXP)
If
you want to process XML document using Java, then you can use JAXP. JAXP
stands for Java API for XML Processing. You can download these API from
the Sun website sun.com. You can get the specifications and also the source
code from the website.
_______________________________________________
JAXP
has a set of classes and methods that are used to process XML documents.
Classes to create DocumentBuilderFactory, DocumentBuilder, and Documents
are available.
There are
methods to create elements, get all the elements of an XML document by
tag names, create text nodes, and to append the text nodes to the root
nodes or other elements.
Element rt
= (Element) doc.createElement("book");
rt.appendChild( doc.createTextNode("some_book") );
Consider
the above two statements that is used as a part of a java program used
to handle the XML documents. The first statement creates an element that
is supposed to the root element and the next statement adds a text node
to it.
The 'doc'
is the document object that was previously created. To create a document
object you have to create DocumentBuilderFactory and then a DocumentBuilder.
Lots of samples are 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.
Note
: We never rent, trade, or sell my email lists to
anyone.
We assure that your privacy is respected
and protected.
_______________________________________
Recommended
XML Books
|
|