I am getting a wrong document error that I have tried a number of ways to solve. I'd very much appreciate any help you can give.
The error is thrown at line 90. This code has gone through many iterations before getting to here as I've tried to solve the problem many different ways. The reason for the System.out.println was so that I could see how many records xpath found. I discovered it found 3. Thinking I was saving time, the first time around, I tried:
Then I skipped all the Element creation and NodeList iteration. Of course, there are three nodes and I got back only in my
String representation when I tried that. Since then I'm trying to add each node (and all its children) to an empty Document. If the code does not make it clear, my purpose here is to Transfomer a Document into a well-formed String representation of the paired down XML Document created from the starting XML Document. Document A has n numbers of parent Nodes and Document B will have n - (Nodes where some child Node != some node_name and some child node != some node_value). Maybe there's an easier way to go about all this?
Appreciate any help.
Regards,
Al