This week's book giveaway is in the JDBC and Relational Databases forum.
We're giving away four copies of Murach's MySQL and have Joel Murach on-line!
See this thread for details.
Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAXP-DOM Node Import Issue

 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Marshal
Posts: 28123
94
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic