Im looking at the XMLNodeList Page in the documents.
Here is the code:
[code]// Load XML
Dim xml As New XmlDocument
Try
xml.LoadXml(kTestXml)
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”))
Next[/code]
Here is the example XML
<?xml version="1.0" encoding="UTF-8"?>
<League>
<Team name="Seagulls">
<Player name="Bob" position="1B" />
<Player name="Tom" position="2B" />
</Team>
<Team name="Pigeons">
<Player name="Bill" position="1B" />
<Player name="Tim" position="2B" />
</Team>
<Team name="Crows">
<Player name="Ben" position="1B" />
<Player name="Ty" position="2B" />
</Team>
</League>
What I can’t figure out is the proper user of the search terms.
nodes = xml.XQL("//Player") // Find all Player nodes in XML
How does the search work and why is there a “//” in the search term?
Also Given the XML that is shown on the manual page why does the phrase “name” work here?
MsgBox("Player: " + node.GetAttribute("name"))
Finally Given:
<?xml version="1.0" ?>
<response>
<result>
success
</result>
<get_users_response>
<users>
<user>
geoff
</user>
<user>
jason
</user>
<user>
thom
</user>
</users>
</get_users_response>
</response>
What doI use to get the 3 users from this?