I have the below structure of an XMl file.
<payment>
<sender>
<name></name>
<sender>
<receiver></reciver>
<amount>
<value></value>
</amount>
</paymnet>
I have tried using may different ways of doing this but can only ever target an individual node, I need to be able to say I want to update the value in payment -> sender -> name
as there is more then on name element in the file and at present when I modify the name
node it updates every occurrence of name
in the XML file.
This is what I'm using at present (taken from Changing tag data in an XML file using windows batch file):
setlocal enableDelayedExpansion
set "newValue=myNewValue"
type "fileName.xml"|repl "(<name>).*(</name>)" "$1!newValue!$2" >fileName.xml.new
move /y "fileName.xml.new" "fileName.xml"
Any help greatly appreciated.
No comments:
Post a Comment