Bug in gnu.xml.dom.DomNode.appendChild()
Christoph PERMES <[email protected]> Sun, 16 Oct 2005 17:49:21 +0200 (CEST)
| Newsgroups | gmane.comp.java.classpath.extensions.xml |
|---|---|
| Organization | HTL Kaindorf |
| Message-ID | <150540.1129477761579.SLOX.WebMail.wwwrun@idefix1.htl-kaindorf.ac.at> |
This simple Java DOM example causes an exception when calling method
appendChild():
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.newDocument();
Element element = doc.createElement("element");
doc.appendChild(element); // this line causes an exception
When compiling this simple program with gcj following Exception occures:
gnu.xml.dom.DomDOMException: The node was not found in that context.
Node Name: element
gnu.xml.dom.DomDOMException: The node was not found in that context.
Node Name: element
at gnu.xml.dom.DomNode.removeChild(org.w3c.dom.Node)
(/usr/lib/libgcj.so.6.0.0)
at XMLTest.main(java.lang.String[]) (Unknown Source)
at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
My gcj version is
gcj (GCC) 4.0.1 20050727 (Red Hat 4.0.1-5)
but the error also occures with other gcj-4.0 compilers
When compiling the program into a class-file and executing it with gij
it works fine.