Dynamic DOCTYPE generation
2 posts in topic
Flat View  Flat View

Posted By:   Ravi_kiran
Posted On:   Monday, February 18, 2002 05:55 AM

I want to generate an XML using JAXP parsers and i want to include a DOCTYPE tag that references a dtd. how can i do that? can anyone please help me out?

Re: Dynamic DOCTYPE generation

Posted By:   Bruce_Martin  
Posted On:   Friday, February 22, 2002 09:16 AM

The DOM API allows for the creation of a DOCTYPE. The DOMImplementation
interface defines a createDocumentType() method. The DOMImplementation
interface can be obtained from a Document.

Re: Dynamic DOCTYPE generation

Posted By:   Chandra_Patni  
Posted On:   Monday, February 18, 2002 04:29 PM

Please refer to forum entry http://www.jguru.com/forums/view.jsp?EID=759148. The example, includes DOCTYPE declaration programmatically. You may want to get rid of the following lines in the code, which are used for printing and are not JAXP compliant.

if(doc instanceof oracle.xml.parser.v2.XMLNode) {
try {
((oracle.xml.parser.v2.XMLNode)doc).print(new PrintWriter(System.out));
catch(IOException ioe) { ioe.printStackTrace();};


Please ignore the begining of the answer, "The lastest production..." which should have been "The latest production... "

About | Sitemap | Contact