ok how would i make an app that reads a .xml and displays its stuff for example inside the .xml is
<name>bobby</name>
<age>7</age>
<name>bob</name>
<age>23</age>
how would i make it display
bobby
7
bob
23
in a listbox?
Printable View
ok how would i make an app that reads a .xml and displays its stuff for example inside the .xml is
<name>bobby</name>
<age>7</age>
<name>bob</name>
<age>23</age>
how would i make it display
bobby
7
bob
23
in a listbox?
Try this sample (was done some time ago) - you'll need to set reefrnces to MS XML 3.0:
VB Code:
Private Sub Command1_Click() '=================================== Dim xml As New MSXML2.DOMDocument30 Dim nds As MSXML2.IXMLDOMNodeList Dim nd As MSXML2.IXMLDOMNode Dim bRes As Boolean bRes = xml.Load(App.Path & "\test.xml") Set nds = xml.selectNodes(LCase("//name")) Set nd = nds(0) Debug.Print nd.Text Set nds = xml.selectNodes(LCase("//text")) Set nd = nds(0) Debug.Print nd.Text Set xml = Nothing Set nds = Nothing Set nd = Nothing End Sub
is there a way to do it without treeviewQuote:
Originally Posted by RhinoBull
MG ... what treeview? XML also has nodes ... :)