The basis
to work with an XML document or to create an XML document from the scratch
is to have a document object in place. So, your first task should be
to create a document object using the classes and methods available
for that purpose in Java.
_______________________________________________
_______________________________________________
Creating
a document object involves three steps. The first is to create a DocumentBuilderFactory
object. The second is to create a DocumentBuilder object with that DocumentBuilderFactory
object. Now in the third step you can create the Document object using
the Document Builder object. A typical code should be,
DocumentBuilderFactory
dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
doc = db.newDocument();
You can
use the getDocumentElement() method to get the root node and then you
can use the appendChild() method to append the elements created, to
the root node. To create the text nodes, you can use the method createTextNode()
of the document object.
Manipulating
the existing XML document is also possible and there are methods to
traverse the nodes and to change them or to remove them. You can also
traverse the nodes and then create attributes.
IT's an open marriage (CIOL)
The erstwhile Bharat Matrimony group, now Consim, has been trying to tie many knots in the portal world from online matrimony, job searches, buying and selling of property, automobiles, etc.
Saving Your Investment: Transforming J2EE applications into Web 2.0 using GWT (SYS-CON Media)
The pressure is on to keep pace with Web 2.0 entrants into the marketplace. Rewriting is expensive; adding AJAX widgets results in a complex, unmaintainable application. Both require you to hire scarce JavaScript developers. Google Web Toolkit -- the SDK that allows you to write AJAX interfaces in Java -- enables your Java developers to layer a desktop-like interface on top of your Web app. ...