Robert Schuster wrote: > When run as 'echo "<a/>" | jamvm -cp . xmlfilter.XMLFilter' you get the > following exception: > > gnu.xml.dom.DomDOMException: The node doesn't belong here. > More Information: document element already present: > gnu.xml.dom.DomElement[a] > Node Name: new > at gnu.xml.dom.DomDocument.checkNewChild (DomDocument.java:294) > at gnu.xml.dom.DomDocument.appendChild (DomDocument.java:317) > at xmlfilter.XMLFilter.main (XMLFilter.java:42) > > You get the same message with all proprietary JDKs prior to 1.5 . The > latest incarnation however accepts creating the <new> node and generates > the following XML upon calling 'echo "<a/>" | > /opt/sun-jdk-1.5.0/bin/java xmlfilter.XMLFilter': > > <?xml version="1.0" encoding="iso-8859-1"?> > <a/> > <new/> > > AFAIK there should/must be only one top-level node which is named <xml>. > > I am confused ... > Is Sun breaking the rules here?
According to http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/Node.html#appendChild(org.w3c.dom.Node) HIERARCHY_REQUEST_ERR: Raised ... if this node is of type Document and the DOM application attempts to append a second DocumentType or Element node. If you want to add arbitrary node types, use a DocumentFragment. -- Chris Burdess _______________________________________________ Classpath mailing list [email protected] http://lists.gnu.org/mailman/listinfo/classpath

