David, When you are appending or inserting something to a document that is not created on that document it self (by createElement or createTextNode) you have to use 'importNode' tot import the new element to your document. The imported node that this method returns should be appended to the document.
You can get the document of each node by using the <node>.getOwnerDocument() method. suc6, Henry ----- Original Message ----- From: "David M. Hirst" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, April 14, 2002 6:24 AM Subject: Please Help > Hi There, > I've been working with the latest Xerces parser to create HTML and > XML documents. I'm running into some problem using it for HTML. Say for > example I would like to create a <title> element I'm getting the following > error > Exception in thread "main" org.w3c.dom.DOMException: DOM006 Hierarchy > request error at org.apache.xerces.dom.CoreDocumentImpl.insertBefore(CoreDocumentImpl. > java:382) at org.apache.xerces.dom.NodeImpl.appendChild(NodeImpl.java:230) > > This happens when I try using the HTMLDocumentImpl.setTitle method, or if > I create a HTMLHeadElementImpl and then append that to the document. Has > anyone run into this problem? Have any suggestions. I am really running > into a dead end here and would appreciate any pointers. > > Thanks a million > Dave > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
