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 Is it possible to generate XML from a DTD and ResultSet Object 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 "Is it possible to generate XML from a DTD and ResultSet Object" Watch "Is it possible to generate XML from a DTD and ResultSet Object" New topic
Author

Is it possible to generate XML from a DTD and ResultSet Object

Nikhil Vasaikar
Greenhorn

Joined: Sep 09, 2003
Posts: 22
Can we generate an XML File using a DTD and a ResultSet Object?
I have a deadline for my deliverable. What I am trying to achieve is mentioned in my post which has the multiple nesting of parent child nodes.
[ October 02, 2003: Message edited by: Nikhil Vasaikar ]
Tony Yan
Ranch Hand

Joined: Apr 10, 2002
Posts: 170
Interesting thought. Typically, you validate an XML with a DTD. I think given a DTD, there can be mutiple instance of XML's that validatable against it. Therefore, in principle, you can get mutiple (underterministic) XML instances from one DTD and a ResultSet. I guess the easiest way is to generate XML from the RS and validate it against the DTD.
Hope it makes sense.


Tony Yan<br /> <br />IBM Certified Developer XML and Related Technology<br />Sun Certified Web Component Developer For J2EE Platform<br />Sun Certified Programmer For Java 2 Platform
Nikhil Vasaikar
Greenhorn

Joined: Sep 09, 2003
Posts: 22
Your suggestion definitely makes sense. I am using DOM to generate XML file from a ResultSet. In doing so i have to hard code the parent chid nesting at multiple levels. If I have a DTD in which all parent child nodes are defined then all I have to do is pick up the nesting from the DTD and generate the XML. This aproach will also help me in maintaining the code, say later on if i wish to change the parent child nesting all I have to do is change the nesting in the DTD. Well, this is just my perception. Correct me if I am wrong.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it possible to generate XML from a DTD and ResultSet Object
 
Similar Threads
OpenOffice File Conversion formats
Another JDOM Question
Generate xsl from DTD
jdbc resultset to xml
Converting resultset into hierarchical XML