views:

135

answers:

1

Hi,

I am dynamically creating a DOM object and need to add following doctype to the XML file in java:

<!DOCTYPE MyXml [<!ATTLIST node id ID #REQUIRED>]>

I am using org.w3c.dom, is there any way we can do this?

Regards, Abhishek

+1  A: 

The org.w3c.dom just provides the interfaces for the DOM. Are you implementing these interfaces?

Otherwise, if you are using a library like JDOM, it's very simple.

See http://www.jdom.org/docs/apidocs/org/jdom/DocType.html

marklai
yes, but Sun provides a built-in implementation of the API. If you are suggesting another library, tell him how to achieve the desired goal there.
Bozho