[OT] create XML based on DTD from resultset on fly

2003-11-03 Thread Ashish Kulkarni
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,
I have to create a PDF file from this XML and i have
already desinged a XSLT for converting this XML to
PDF.
So my flow would be

DTDXSLT
 |   |
 |   | 
 v   v  
resultset -->create XML on fly ---> xslt process
-->pdf

Any suggestions or code
Ashish

__
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT] create XML based on DTD from resultset on fly

2003-11-03 Thread Adam Hardy
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).

Adam

--
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]