aspose file tools*
The moose likes XML and Related Technologies and the fly likes JAXP-DOM  Node Import Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "JAXP-DOM  Node Import Issue" Watch "JAXP-DOM  Node Import Issue" New topic
Author

JAXP-DOM Node Import Issue

Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874


Hi ,

I tried to parse a XML using JAXP DOM implementations and used getElementsByTagName() to get to a particular Node and



But the API has something like this "User data associated to the imported node is not carried over. " , But I dint even get the childNodes. Any body tried this before ? .

Alternatively , is there any way i can persist a particular Node( with node values) to a new Document ? Thanks.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

That's how you do it. I don't see any code where you test the number of children in the source node, so perhaps you are mistaken about the number of children it has.
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874



That's how you do it. I don't see any code where you test the number of children in the source node, so perhaps you are mistaken about the number of children it has.



Yup, but the documentNew.getChildNodes().item(0) returns null. I will double check it anyways. BTW user data(Node value) are not imported to new document ? because the main requirement i go with this approach is to get the Node value.Thanks Paul.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAXP-DOM Node Import Issue