I am having difficulty programmatically creating a DOM
Document with a doctype declaration. My current take on the situation is:
DOMImplementationImpl dii =
(DOMImplementationImpl)
DOMImplementationImpl.getDOMImplementation();
DocumentType dtd =
dii.createDocumentType(
"mydtd",null,"/c:/temp/mydtd.dtd");
Document d = dii.createDocument(null,null,dtd);
d.appendChild(dtd);
Element e = d.createElement("anElement");
d.appendChild(e);
This fails at d.appendChild(dtd), because dtd.getOwnerDocument() returns null.
What am I missing here?
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
- chicken and egg problem w/ Document and DocumentType Kip Lubliner
- chicken and egg problem w/ Document and DocumentType Kip Lubliner
