I don't think you have to clone the node before invoking importNode. I believe importNode does this for you. Try removing the call to cloneNode to see if that will help.
-----Original Message----- From: Henry Kleynhans [mailto:[EMAIL PROTECTED] Sent: Monday, May 07, 2001 12:50 PM To: Xerces Users Subject: Help: XML Parsing & Xerces. Hi All, I have a problem when trying to create one XML document as a subset from another XML document. I have a document that has a structure similar to this: <NODE> <CHILDNODE> <ANOTHERCHILD> </ANOTHERCHILD> <ANOTHERCNILD> </ANOTHERCHILD> </CHILDNODE> <CHILDNODE> </CHILDNODE> </NODE> I would like to split this document into subdocuments. I get the various nodes I want by doing an xpath query with Xalan. Then I want to create documents from the nodelist. Here is my attempt at coding it: Node n; while ((n = nodeList.nextNode()) != null) { Node clone = n.cloneNode(true); Document querydoc = new DocumentImpl(); Node cn = querydoc.importNode(clone, true); querydoc.appendChild(cn); docList.add(querydoc); } This compiles and runs, but when I try to find the attributes of, and perform further xpath queries on these subdocuments, I don't seem to be able to get any data back. Can anyone point out the error in my ways/offer any advise? Thanks in advance, Henry -- Henry Kleynhans Obsidian Labs Systems Engineer South Africa [EMAIL PROTECTED] Tel: +27 11 792 6500 http://www.obsidianlabs.com/ Fax: +27 11 792 6522 --------------------------------------------------------------------- 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]
