Hello,
Can someone please help me out here. I'm trying to input a value into an XML node. For example:
Here is my XML code
Code:XML Code
<rootvalue>
<MsgBody>
<RouteMe>
<Operation></Operation>
<RouteDestination></RouteDestination>
</RouteMe>
</MsgBody>
</rootvalue>
I need to constantly change the value inside <Operation> and <RouteDestination>. I wrote the following code to change the string values.
VB6 Code:
Dim objRequestDOM As New MSXML2.DOMDocument40
Dim objReplyNode As MSXML2.IXMLDOMElement
Dim OperationVal As String
Dim Route As String
On Error GoTo ErrorHandler
If Not objRequestDOM Is Nothing Then
Set objRequestNode = objRequestDOM.selectSingleNode("//MsgBody/RoutingMe")
If Not (Operation = "") Then
objRequestNode.selectSingleNode("Operation").Text = OperationVal 'Is this how you write the value into the node?
End If
If Not (Route = "") Then
objRequestNode.selectSingleNode("RouteDestination").Text = Route
End If
End If
Can someone please help me out? I need to finish this project soon. Thanks.
- Raux


Reply With Quote
