Skip to main content
Question

Updating multiple occurrences of an XML element

  • July 13, 2023
  • 1 reply
  • 19 views

babar_ali99
Contributor
Forum|alt.badge.img+2

 

<mdContact>

<rpOrgName>AAA</rpOrgName>

<rpPosName>BBB</rpPosName>

 

rpOrgName is appearing at multiple locations in the XML file.

How can I update its value from AAA to CCC for all of them in a single go without having to go to each element using Xpath.

1 reply

geomancer
Evangelist
Forum|alt.badge.img+50
  • Evangelist
  • July 13, 2023

One possible way would be to read the xml as a text file with parameter Read Whole File at Once set to 'Yes'. Use a StringReplacer to change all occurences of <rpOrgName>AAA</rpOrgName> with <rpOrgName>CCC</rpOrgName>, and write the results to a text file with extension xml.

image


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings