Can someone be so kind as to give me a real simple XML parsing example. For example, If I have the following XML returned from a server how would I assign the 2 values to 2 variables in Xojo?
<?xml version="1.0"?>
<countries>
<countryid>22</countryid>
<countryname>United Kingdom</countryname>
</countries>
Assuming you put that XML into a variable data
:
dim xml as new XMLDocument( data )
dim f as XMLNode = xml.FirstChild
dim countryID as string = f.Child( 0 ).FirstChild.Value
dim countryName as string = f.Child( 1 ).FirstChild.Value
Just to give you an idea.
That should get me started. Many thanks Kem
Also check out the XMLExample which shows you how to load and display an XML file in a ListBox:
Examples/Text/XMLExample