This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > February 2005 > VB6 and XML





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author VB6 and XML
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!


Samu Lang

2005-02-23, 7:18 am

Add

oXMLDocument.setProperty "SelectionLanguage", "XPath"

Before the call to selectSingleNode.





http://msdn.microsoft.com/library/d...ionLanguage.asp


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews