Question : Inserting an action inside a Node with xPath

Hello-

If I want to grab a node and add in an additional statement inside Gather how can I do that? I currently have the following code for Removing a node, just not sure how to update one and include additional data? So I would take what i have now with Gather and add subdigit="1" after the timout="3"

<?xml version=""1.0"" encoding=""utf-8"" ?>
<Response>
<Gather method=""POST"" numDigits=""1"" timeout=""3"">
 <say>Hello Wold</say>
</Gather>
</Response>
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
Set objXML = Server.CreateObject("Microsoft.XMLDOM") 
objXML.async = False
objXML.LoadXML (ResponsePage)
If objXML.parseError.errorCode <> 0 Then 
   Response.Write "Error in loading xml" 
   Response.End 
End If 

objXML.setProperty "SelectionLanguage", "XPath"
'obtain a reference to the node you want to delete
If Not objXML.selectNodes("//Gather/SMS")(0) IS NOTHING Then
Set SMS1 = objXML.documentElement.selectNodes("//Gather/SMS")(0)
SMS1Text = SMS1.Text
SMS1Number = SMS1.Attributes.getNamedItem("number").Text
end if
if Not objXML.selectNodes("//Gather/SMS")(1) IS NOTHING Then
Set SMS2 = objXML.documentElement.selectNodes("//Gather/SMS")(1)
SMS2Text = SMS2.Text
SMS2Number = SMS2.Attributes.getNamedItem("number").Text
end if

Set Gather = objXML.documentElement.selectSingleNode("//Gather")
'remove it from it's container

if isObject(SMS1) then
Gather.removeChild(SMS1)
end if

if isObject(SMS2) then
Gather.removeChild(SMS2)
end if

For Each node in objXML.childnodes
	Response.Write(node.xml)
Next

Answer : Inserting an action inside a Node with xPath

Simplisticly all you need to do is the following:
1:
2:
    Set node = objXml.SelectSingleNode("//Gather")
    node.setAttribute "subdigit", "1"
Random Solutions  
 
programming4us programming4us