vb6 to xojo conversion - xml nodes

Hi everyone!

I got the following piece of code in vb6 to show some xml nodes:

For i = 0 To oNodo.Attributes.length - 1
        If oNodo.Attributes(i).baseName = "total" Then
        Total = oNodo.Attributes(i).Text
        End If
Next i
If oNodo.hasChildNodes Then
        MuestraNodos oNodo.childNodes
End If

I can`t figure out how to convert it to xojo.
Any comment are welcome.

take a look here.
Xml
XMLDocument
and /Examples/text ,in xojo

See http://documentation.xojo.com/index.php/XMLNode.GetAttributeNode

Total = oNodo.GetAttributeNode("total")

And http://documentation.xojo.com/index.php/XMLNode.ChildCount hasChildNodes is the equivalent of ChildCount > 0.

Xojo has no concept of a childnodes object, you reference the children as properties of the parent for example oNodo.Child(0). See http://documentation.xojo.com/index.php/XMLNode.Child.

There is a great deal of information in these forums on XML. There is also a book on it XML with Xojo :slight_smile: