This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes XML DOM Question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "XML DOM Question" Watch "XML DOM Question" New topic
Author

XML DOM Question

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 948
When you're building XML in code for a particular XML structure, are there any shortcuts to building the XML file (like document.CreateXMLFromSchema())?
Since each XML document is different there's always at least one DOM method I'd have to override to build that XML document (to create the nodes).
I'm interested in hearing about how anybody quickly builds an XML file from a DTD/Schema/Data or otherwise (if any of these are faster than manually coding each XML file separately.)
Thanks!!!
-- Mike
Steven Broadbent
Ranch Hand

Joined: Dec 10, 2002
Posts: 400
with xml spy there is an option to create xml from a db table, although I have not used it.


"....bigmouth strikes again, and I've got no right to take my place with the human race...."<p>SCJP 1.4
Andy Bowes
Ranch Hand

Joined: Jan 14, 2003
Posts: 171
I would suggest that you have a look at JAXB from Sun (Java Technology & XML). It automatically creates a set of Java classes based on an XML schema definition to allow you to manipulate the XML document as if it is made up of java objects.
As an alternative, if you don't have a full schame then you could have a look at using JDOM (JDOM Home Page) to manipulate the XML elements. It's a lot simpler than using the Xerces API
HTH
Andy Bowes


Andy Bowes<br />SCJP, SCWCD<br />I like deadlines, I love the whoosing noise they make as they go flying past - Douglas Adams
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: XML DOM Question
 
Similar Threads
Problem in writing DOM Object with PI
Inserting a DOCTYPE declaration into DOM
Searching XML elements using text and work with siblings
XML and Java
How to extract an xml file after matching content from a zip file using java