Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to modify XML file in VBscript?

Status
Not open for further replies.

Seungweon

Programmer
Mar 3, 2008
2
US
Hi there, I am a newbee at XML.
I'd like to modify some tag's value in XML file in VBscript.

For example, I'd like to get name tag's text "CISCO-1200" and modify this value to "NETGEAR". Is there simple idea?

thank you in advance.
SW.

----
<?xml version="1.0"?>
<WLANProfile xmlns=" <name>CISCO-1200</name>
<SSIDConfig>
<SSID>
<hex>434953434F2D31323030</hex>
<name>CISCO-1200</name>
</SSID>
</SSIDConfig>
<connectionType>ESS</connectionType>
<connectionMode>auto</connectionMode>
<MSM>
<security>
<authEncryption>
<authentication>open</authentication>
<encryption>none</encryption>
<useOneX>false</useOneX>
</authEncryption>
</security>
</MSM>
</WLANProfile>
----
 
So what form of the script have you actually adapted from that reference? The only difficulty you might find is how to treat the namespace (default). You can use an arbitrary prefix for it. At these two places, like this.
[1][tt]
snsurl="xmlns:dns='[ignore][/ignore]'"[/tt]
[2] and then
[tt] set onodelist=oparser.documentelement.selectnodes("//dns:name")[/tt]

The replace (to NETGEAR) operation is elementary vbs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top