modifying an xml tag

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 15 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
jimbo101974
Posts: 40
Last visit: Mon Jan 12, 2009 4:52 am

modifying an xml tag

Post by jimbo101974 »

Hello all
Wondering if someone out there can help me with a problem I am having. I have an xml file that contains a tag called <SERIESNUMBER>. Within that tag there is a number. I am trying to write a script to change that number. I have been unsuccessful in finding any information describing this. I wrote the following to extract and show the tag but that is about as far as I've gotten.

Set objXMLDoc = CreateObject("Microsoft.XMLDOM") objXMLDoc.async = False objXMLDoc.load("c:tmpsettings.xml")
Set NodeList = objXMLDoc.documentElement.selectNodes("SERIESNUMBER") For Each Node In NodeList WScript.Echo(Node.Text)Next

Thanks
Jim
User avatar
jimbo101974
Posts: 40
Last visit: Mon Jan 12, 2009 4:52 am

modifying an xml tag

Post by jimbo101974 »

Hello all
Wondering if someone out there can help me with a problem I am having. I have an xml file that contains a tag called <SERIESNUMBER>. Within that tag there is a number. I am trying to write a script to change that number. I have been unsuccessful in finding any information describing this. I wrote the following to extract and show the tag but that is about as far as I've gotten.

Set objXMLDoc = CreateObject("Microsoft.XMLDOM") objXMLDoc.async = False objXMLDoc.load("c:tmpsettings.xml")
Set NodeList = objXMLDoc.documentElement.selectNodes("SERIESNUMBER") For Each Node In NodeList WScript.Echo(Node.Text)Next

Thanks
Jim
User avatar
jimbo101974
Posts: 40
Last visit: Mon Jan 12, 2009 4:52 am

modifying an xml tag

Post by jimbo101974 »

Perfect thank you. I knew it had to be much easier than the information I was finding online.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

modifying an xml tag

Post by jvierra »

The XMLDOM is documented on the MSDN site but you need to search hard for the full API.

The W3C site has some pretty good examples for both HTMLDom and the XMLDom.
This topic is 15 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked