From Xojo Documentation

Class (inherits from Object)

Stores the results of an XQL query done by the XQL method of the XMLNode class.

LastError Length

Item ToString


The example code below uses this XML. Assign it to a constant called kTestXML:

 <?xml version="1.0" encoding="UTF-8"?>
 	<Team name="Seagulls">
 		<Player name="Bob" position="1B" />
 		<Player name="Tom" position="2B" />
 	<Team name="Pigeons">
 		<Player name="Bill" position="1B" />
 		<Player name="Tim" position="2B" />
 	<Team name="Crows">
 		<Player name="Ben" position="1B" />
 		<Player name="Ty" position="2B" />

To get all the player names, you can use "//Player" as the query and loop through the returned XMLNodeList:

// Load XML
Dim xml As New XmlDocument
Catch e As XmlException
MsgBox("XML error: " + e.Message)
End Try

// Display all the Player names
Dim nodes As XmlNodeList
nodes = xml.XQL("//Player") // Find all Player nodes in XML

// Loop through results and display each name attribute
Dim node As XmlNode
For i As Integer = 0 To nodes.Length - 1
node = nodes.Item(i)
MsgBox("Player: " + node.GetAttribute("name"))

See Also

XMLNode class, XMLNode.XQL method