• 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

How to Go To Certain XML Nodes and Update Their Values

 
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have a XML file. I have problem with going to certain nodes and need help.

For example, I want to update the value "000001101" of the <content ID="f002">000001101</content> for the <item ID="SSN">. I can go ClinicalDocument/component/structureBody/component/section/text/list/, thereafter, I do not know how to proceed to get to the <content ID="f002">.

 
Marshal
Posts: 28177
95
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
I would probably use the DOM parser for that. And if I did, I would certainly use XPath to identify the element I wanted to work with.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Natalie!

I agree with Paul, XPath should do the trick.You should try something like this right here:



And after using the correct XPath to content ID(in expression) and the correct path to your XML File, you may read the value contained inside the item.
Now all you need to do is to overwrite this specific value and it´s done ;)
reply
    Bookmark Topic Watch Topic
  • New Topic