| Sakinah 2005-02-23, 7:18 am |
| hello world,
if have write code in VB6 to communicate with XML file. how to search
contained in node value in VB6. need help
my XML file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<vocabulary>
<word>
<english>aback</english>
<bm>terperanjat,ke belakang,terkejut</bm>
</word>
<word>
<english>abacus</english>
<bm>cempoa,sempoa,cipoa,dekak,pembilang,penghitung</bm>
</word>
<word>
<english>abandon</english>
<bm>meninggalkan,menghentikan</bm>
</word>
</vocabulary>
my code:
Dim oXMLDocument As MSXML2.DOMDocument
Dim oXMLNodelist As MSXML2.IXMLDOMNodeList
Dim oXMLNodes As MSXML2.IXMLDOMNode
Set oXMLNodelist =
oXMLDocument.selectSingleNode("/vocabulary/word/bm[contains(.,'" &
txtQuery.Text & "')]") '<<<error this line
If Not oXMLNodelist Is Nothing Then
If oXMLNodelist.length > 0 Then
'Loop though each node in the node list
For Each oXMLNodes In oXMLNodelist
strWords = oXMLNodes.Text
ListBox1.AddItem (strWords)
Next
End If
End If
message error:
-2147467259Unknown method
/vocabulary/word/bm[-->contains(.<--,'strQry')]
--
Life is a great journey!
|