+ Start a Discussion
ra1ra1 

Adding DOCType while writing XML using DOM

Hi,

I am working on one integration requirement which uses XML over HTTP. Here I am using DOM writer to generate the XML. Everything works fine except I am not able to add DOCType statement within it. wondering if someone can help me on this.
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE ROOT_TAG SYSTEM 'http://<server address>/<DTD file name>.dtd'>
<ROOT_TAG attribute1='1.0'>
...
</ROOT_TAG>


As of now, I am adding this DOCType using String replace method (generate XML and then use replace to inject extra line i.e. DOCType. But I would like to go with proper/inbuild solution.