Return-Path: Mailing-List: contact general-help@xml.apache.org; run by ezmlm Delivered-To: mailing list general@xml.apache.org Received: (qmail 38382 invoked from network); 1 Mar 2000 00:07:34 -0000 Received: from mta4.rcsntx.swbell.net (151.164.30.28) by locus.apache.org with SMTP; 1 Mar 2000 00:07:34 -0000 Received: from brak ([216.60.111.107]) by mta4.rcsntx.swbell.net (Sun Internet Mail Server sims.3.5.1999.09.16.21.57.p8) with SMTP id <0FQP00NKRV0J51@mta4.rcsntx.swbell.net> for general@xml.apache.org; Tue, 29 Feb 2000 18:07:31 -0600 (CST) Date: Tue, 29 Feb 2000 18:19:50 -0600 From: Eric Hodges Subject: Another question about using Xerces To: general@xml.apache.org Message-id: <005d01bf8313$dbac9080$2920a8c0@mongoosetech.clk> MIME-version: 1.0 X-Mailer: Microsoft Outlook Express 5.00.2615.200 Content-type: multipart/alternative; boundary="----=_NextPart_000_005A_01BF82E1.90E8EDA0" X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Priority: 3 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_005A_01BF82E1.90E8EDA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I'm trying to build a document using Xerces. Here's some simple code = that demonstrates my problem: public XercesTest() { DOMImplementationImpl imp =3D new DOMImplementationImpl(); Document doc =3D imp.createDocument(null, "Test", null); Element e =3D 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.(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. ------=_NextPart_000_005A_01BF82E1.90E8EDA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I'm trying to build a document using = Xerces. =20 Here's some simple code that demonstrates my problem:
 
  public XercesTest() = {
   =20 DOMImplementationImpl imp =3D new = DOMImplementationImpl();
   =20 Document doc =3D imp.createDocument(null, "Test", = null);
   =20 Element e =3D doc.createElement("dummElement");
   =20 doc.appendChild(e);
  }
 
Here's the error I = receive:
org.apache.xerces.dom.DOMExceptionImpl: = HIERARCHY_REQUEST_ERR
 at=20 org.apache.xerces.dom.DocumentImpl.insertBefore(Compiled = Code)
 at=20 org.apache.xerces.dom.NodeImpl.appendChild(Compiled Code)
 at=20 XercesTest.XercesTest.<init>(XercesTest.java:19)
 at=20 XercesTest.XercesTest.main(XercesTest.java:23)
What's a HIERARCHY_REQUEST_ERR and = where is it=20 documented?
What's the correct way to add a new = element to a=20 document?
 
Thanks.
 
------=_NextPart_000_005A_01BF82E1.90E8EDA0--