You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Jeff Macomber <JM...@NetByTel.com> on 2001/06/06 17:15:25 UTC
Inserting a DOCTYPE in the DOM
Hi all,
I am using xerces 1.2.2 with the DOM implementation. I am trying to insert
the DOCTYPE element to include a system dtd. I have the following code
snippet:
DOMImplementationImpl impl =
(DOMImplementationImpl)DOMImplementationImpl.getDOMImplementation();
DocumentType type = impl.createDocumentType("VALIDATE_RESPONSE", null,
"http://127.0.0.1/architecture/repository/VALIDATE_RESPONSE.dtd");
Document myResponseDoc = impl.createDocument(null,"VALIDATE_RESPONSE",type);
I then continue to append the elements and text nodes in the normal manner.
The methods above do not give an error but when I read out the DOM I am not
seeing the DOCTYPE element appearing. It is a possibility that the problem
lies in the output routines though I have tested this by parsing in an XML
with the DOCTYPE element and writing it out using my routines with out a
problem. I am hoping that some one out there can tell me what I am doing
wrong.
Thanks,
Jeff Macomber
---------------------------------------------------------------------
In case of troubles, e-mail: webmaster@xml.apache.org
To unsubscribe, e-mail: general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org