My XML looks like this.
I would like to "export" collected_objects into another document. Here is my code-
NodeList nList = reader.getElementsByTagName("collected_objects");
for (int temp = 0; temp < nList.getLength(); temp++) {
Node nNode = nList.item(temp);
output.importNode(nNode, true);
}
output refers to the new document I want to write to.
The code is not importing anything from source document. All I get is XML "header" - <?xml version="1.0" encoding="UTF-8" standalone="no"?>
I was expecting that since I've set deep
to true, all of the child nodes will be imported but that is not happening.
What am I doing wrong?