开发者

How to add doctype with ID attribute to the XML file in java?

开发者 https://www.devze.com 2022-12-20 04:51 出处:网络
I am dynamically creating a DOM object and need to add following doctype to the开发者_如何学C XML file in java:

I am dynamically creating a DOM object and need to add following doctype to the开发者_如何学C 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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消