** RESOLVED ** Need help with XML
Hello there,
I'm trying to parse the following XML data:
http://members.lycos.co.uk/sjrseh/xml.txt
The "game" tag is repeated throughout the file.
I have XML4 referenced and have spent some time playing around with the following code:
VB Code:
Dim xml_document As DOMDocument
Dim mame_node As IXMLDOMNode
Set mame_node = xml_document.selectSingleNode("mame")
txtName.Text = GetNodeValue(mame_node, "game", "???")
Which gives me "description", "year" and "manufacturer". I want to retrieve other details like "driver status". I also want it to loop through the whole 30MB file for all 6000+ game entries.
It is for my non profit project I started quite a few years back, that uses mame.exe. http://members.lycos.co.uk/sjrseh/
Any help much appreciated.
Re: ** RESOLVED ** Need help with XML
You could concatenate an empty string to the end of the return so you don’t get an error if a node has a null vaule
Litem.SubItems(2) = objChildNode.Text & ""
Re: ** RESOLVED ** Need help with XML
Or maybe this would be better
VB Code:
If Not objChildNode Is Nothing Then Litem.SubItems(2) = objChildNode.Text
Re: ** RESOLVED ** Need help with XML
Quote:
Originally Posted by MarkT
Or maybe this would be better
VB Code:
If Not objChildNode Is Nothing Then Litem.SubItems(2) = objChildNode.Text
Hehe, yeah that does it :D
Thanks again.