Basic XML/Scripting question

  • Thread starter Thread starter FE-FR
  • Start date Start date
F

FE-FR

Hi,

I know quite nothing on XML scripting.

I need to create a small script to remplace the value of a node in an XML
file.

For ewample :

<MyNode>This is the data I need to change</MyNode>

And I need to make a script to get this :

<MyNode>NewData</MyNode>


I need to do on Microsoft Windows OS, with VBS.

Can you advise me ?

Thanks

FE
 
Try

set x=createobject("msxml2.domdocument")
x.loadxml "<MyNode>This is the data I need to change</MyNode>"
msgbox x.xml
set node=x.selectsinglenode("//MyNode")
node.text="New Node"
msgbox x.xml
 
Back
Top