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 ]
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
Joined: Sep 09, 2003
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.