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
 
FE-FR said:
I need to do on Microsoft Windows OS, with VBS.

This is a newsgroup on Visual Basic .Net.
Try microsoft.public.scripting.vbscript instead.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top