This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Creating an XML file programmatically from scratch Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Creating an XML file programmatically from scratch" Watch "Creating an XML file programmatically from scratch" New topic
Author

Creating an XML file programmatically from scratch

Gabriel Cane
Ranch Hand

Joined: Mar 27, 2001
Posts: 39
What's the best way to programmatically create an XML file from scratch, using data from a database and config files?
What classes should I use? How should I approach the problem?
We haven't set a firm DTD/XSD schema yet, so I won't be able to use either dtd's or xsd's to validate the structure.
Thanks.


Sun Certified Programmer for the Java 2 Platform
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Look at the reply I got, and use his code. After you see the XML it creates, then you can modify it to make it more custom for your app. But it is a great starting point.
http://www.coderanch.com/t/124928/XML/Getting-XML-ResultSet
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
jQuery in Action, 2nd edition
 
subject: Creating an XML file programmatically from scratch
 
Similar Threads
how to modify hibernate.cfg.xml at runtime?
Total no. of questions
how to create Xml file programmatically
Write an XML file with SAX?
xml conversion