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
|