title: VBScript to modify an Element (of many, with same Element names but with different Attributes)?
body: <p>I need to write a simple VBScript to modify an existing XML file. I am able to write a VBScript to modify an element, but the problem I am currently encountering is that I have multiple elements with the same Element/tag names but different ATTRIBUTES as the below XML document sample shows:</p>
  
  <pre><code>&lt;MyDoc&gt;
     &lt;Section name="First"&gt;
        &lt;....../&gt;
    &lt;/Section&gt;
    &lt;Section name ="Second"&gt;
       &lt;......&gt;
       &lt;Parameter name="Service" value="MsrNdp.dll"/&gt;
     &lt;/Section&gt;
   &lt;/MyDoc&gt;
  </code></pre>
  
  <p>Let's assume I wanted to change ONLY the "value" of the parameter "Service" to "LdrXMP.dll" (then save it): Since there is more than one Element called "Section", how would I specify that I am reffering to the Element "Section" whose attribute value = "Second" ??</p>
  
  <p>I have the following simple VBScript code so far: How can I tweak my code below to get what I want? Thanks for your help.</p>
  
  <pre><code>Set xmlDoc = _
    CreateObject("Microsoft.XMLDOM")
  xmlDoc.Async = "False"
  xmlDoc.Load("C:\Users\Frank\Desktop\MyDoc.xml")
  Set colNodes=xmlDoc.selectNodes _
  ("/MyDoc/Section ")
  For Each objNode in colNodes
     objNode.Text = "LdrXMP.dll"
  Next
  xmlDoc.Save "C:\Users\Frank\Desktop\MyDoc.xml"
  </code></pre>