How to create a DTD in JAVA using JAXP v1.2?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   alex_lee
Posted On:   Thursday, December 12, 2002 10:05 AM


I've got a ResultSet and created an XML file from it is not a problem. But how do I create an embedded DTD in that XML document that I created?



I know there is a startDTD() method in LexicalHandler interface, but how do I use it?



Also, to create an element for the DTD there is a elementDecl() method in the DeclHandler interface.



How do I put everything together???



Any help is much appreciated...

Re: How to create a DTD in JAVA using JAXP v1.2?

Posted By:   Roseanne_Zhang  
Posted On:   Thursday, December 12, 2002 05:12 PM


startDTD()
elementDecl()

are callback or event handling methods. They cannot change your XML. How to add a line of DOCTYPE in your xml, the simplest way is just add a line in the result text file, or do an extremely simple XSL Transformation. If you want to make things more complicated, then use DOM/JDOM etc.


Keep It Simple and Stupid (KISS), please!

About | Sitemap | Contact