struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <>
Subject Re: [OT] create XML based on DTD from resultset on fly
Date Mon, 03 Nov 2003 22:36:25 GMT
On 11/03/2003 09:58 PM Ashish Kulkarni wrote:
> Hi,
> i have designed a DTD for my XML file, now i want to
> genereate a XML file based on this DTD on the fly,
> I will run a SQL querry, which will return me a result
> set, i want to create XML file from this resultset, 
> and i dont want to write it to a file, i want to just
> create a XML file so can be used for further
> processing,

Hi Ashish,
check out JAXB xml data binding from Sun. It will definitely do what you 
want, but it might be a bit over the top for your needs.

JAXB has a run-once class-generator which generates a bunch of java 
class based on your DTD. You then incorporate the classes into your 
project at design time. Then at runtime you put the data from the 
resultset into them, and then send the root node object to the 
Marshaller to create the XML. (Or is it the Unmarshaller - I always get 
it confused).


struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message