• Post Reply Bookmark Topic Watch Topic
  • New Topic

Generating !DOCTYPE tag for a Document  RSS feed

 
Nikhil Kumar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the SDK JAXP implementation of DOM to parse a simple XML document containing a !DOCTYPE tag, make a minor modification and write it back to a file. All works fine except that the !DOCTYPE tag is not written to the StreamResult by the Transformer.
getDoctype() on the Document does return a Doctype object that was parsed, but it's not written when transforming the Document into a StreamResult.
How do I write the !DOCTYPE tag into the output?
Please help.
Nikhil
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!