This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes creating a new xml document with dom Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "creating a new xml document with dom" Watch "creating a new xml document with dom" New topic
Author

creating a new xml document with dom

andy yeo
Greenhorn

Joined: Jul 26, 2001
Posts: 3
Sorry I got a real simple question.
I wanted to create a new xml document and then input elements to the document using dom.
My codes goes something like this:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try{
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.newDocument();

Element root=document.createElement("Pip3");
Element fromRole = document.createElement("fromRole");
..................
Is my codes going the right direction? If so how to name the xml file?Please advice. Thanks in advance.
 
 
subject: creating a new xml document with dom
 
Similar Threads
Servlet with XML
Can anyone help?I still can't append records in xml...
How to add attribute to tag in XML uing DOM parser
hashmaps to xml and back
creating a new xml document