Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6713713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:24:45+00:00 2026-05-26T08:24:45+00:00

How to write a vbscript which should search for a specific node in a

  • 0

How to write a vbscript which should search for a specific node in a XML file and replace the value of that node with another value?

So far I can read a node and get the value.

set objXML = CreateObject("Microsoft.XMLDOM")
objXML.async = "false"
objXML.load("E:\sage2\test.xml")
Set Root = objXML.documentElement

For Each x In Root.childNodes

 if x.nodename="showList" then
    plot=x.text
    msgbox plot
 end if
Next

please suggest me some example which should read a specific node in the xml file and replace the value of that node.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:24:46+00:00Added an answer on May 26, 2026 at 8:24 am

    Here is a simple XML edit and save example in VBScript. I recommend lokking into using Xpath to select your node instead of looping over the child nodes, you can provide your XML for more detailed answer.

    Set xmlDoc = CreateObject("Microsoft.XMLDOM")
    xmlDoc.load "MYFILE.xml"
    
    'Locate the desired node
    'Note the use of XPATH instead of looping over all the child nodes
    Set nNode = xmlDoc.selectsinglenode ("//parentnode/targetnode")
    
    'Set the node text with the new value
    nNode.text = "NEW VALUE"
    
    'Save the xml document with the new settings.
    strResult = xmldoc.save("MYFILE.xml")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can i write vbscript that calculates the free space in C: drive of
Is there a macro, VBA code or VBScript that I can write to edit
I need to write a VBScript function that can convert arbitrary strings into a
I have to write something in vbscript that need to use a unique set.
Basic doubt...If QTP generates vbscript code as we record actions, can't we directly write
Write a class ListNode which has the following properties: int value; ListNode *next; Provide
i did the following vbscript code to write a text file called level.txt in
I have to write vbscript that prints all files in a folder. Printer dialog
I want to write a vbscript that will wait for windows shutdown and intercept
I'm trying to write a VBScript that will export and import the code modules

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.