I am trying to create a list of Chapter Officers and their respective positions. The data comes from a series of XML key/value pairs accessed via web service (Key: Member_Name,
Here's how I would probably solve this:
It uses the existing XmlSearch you've done, and assumes Member_Guid
is always the first key/value pair. I've used var/local scope assuming this is going inside a function (which it probably should be), but if not just remove them.
It uses structs so lookup of a particular GUID is easy, but order isn't preserved (though if necessary you could keep a separate array to do that), and you don't have to remember which array position matches to which key.
If you wanted to lookup based on other fields, you could also convert the data into a query, like so:
This maintains order and makes more general lookup easier, also makes it easier if your main use is outputting direct to HTML.
I've hard-coded the column keys there, but you could also do a pre-loop to collate those first, if they are something that is liable to change.
Hopefully this all makes sense?