xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Pogue <mpo...@apache.org>
Subject Re: Another question about using Xerces
Date Wed, 01 Mar 2000 17:21:38 GMT
Eric,

	You should post this to the Xerces list.  But, here's the quick answer:
HIERARCHY_REQUEST_ERR is documented in the XML specification, at:

	http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html

If you debug into the source code, where the exception is thrown, it will probably
give you a lot of info about where the problem is.

Mike

> Eric Hodges wrote:
> 
> I'm trying to build a document using Xerces.  Here's some simple code that demonstrates
my
> problem:
> 
>   public XercesTest() {
>     DOMImplementationImpl imp = new DOMImplementationImpl();
>     Document doc = imp.createDocument(null, "Test", null);
>     Element e = doc.createElement("dummElement");
>     doc.appendChild(e);
>   }
> 
> Here's the error I receive:
> org.apache.xerces.dom.DOMExceptionImpl: HIERARCHY_REQUEST_ERR
>  at org.apache.xerces.dom.DocumentImpl.insertBefore(Compiled Code)
>  at org.apache.xerces.dom.NodeImpl.appendChild(Compiled Code)
>  at XercesTest.XercesTest.<init>(XercesTest.java:19)
>  at XercesTest.XercesTest.main(XercesTest.java:23)
> What's a HIERARCHY_REQUEST_ERR and where is it documented?
> What's the correct way to add a new element to a document?
> 
> Thanks.
>

Mime
View raw message