speakers_86
Registered User.
- Local time
- Today, 15:24
- Joined
- May 17, 2007
- Messages
- 1,919
Anyone know how to do it?
I found this reference, and tried the following code:
The reference I have is Microsoft XML, v3.0.
From the link above, I had to get rid of all of the "MSXML." from the variables, because it would not compile. So MSXML.DOMDocument became DOMDocument.
The blank messagebox does not fire.
I found this reference, and tried the following code:
The reference I have is Microsoft XML, v3.0.
From the link above, I had to get rid of all of the "MSXML." from the variables, because it would not compile. So MSXML.DOMDocument became DOMDocument.
The blank messagebox does not fire.
Code:
Private Function CreateXML as string
Dim strXML as string
strXML="some xml markup"
Dim xDoc As DOMDocument
Set xDoc = New DOMDocument
xDoc.validateOnParse = False
If xDoc.Load(strXML) Then
' The document loaded successfully.
' Now do something intersting.
MsgBox ""
DisplayNode xDoc.ChildNodes, 0
Else
' The document failed to load.
' See the previous listing for error information.
End If
End Function
Code:
Public Sub DisplayNode(ByRef Nodes As IXMLDOMNodeList, _
ByVal Indent As Integer)
Dim xNode As IXMLDOMNode
Indent = Indent + 2
For Each xNode In Nodes
If xNode.NodeType = NODE_TEXT Then
Debug.Print Space$(Indent) & xNode.ParentNode.nodeName & _
":" & xNode.NodeValue
End If
If xNode.HasChildNodes Then
DisplayNode xNode.ChildNodes, Indent
End If
Next xNode
End Sub