Hello group,
I have a some xml that looks like this below:
<tuneRequests ct="3" xmlns:sql="urn:schemas-microsoft-com:xml-sql"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tr xsi:type="trGenericType" number="2">
<s name="KATU" call_sign="KATU" affiliation="ABC Affiliate"
id="28455700" ppv="0" />
</tr>
<tr xsi:type="trGenericType" number="3">
<s name="KOAB" call_sign="KOAB" affiliation="PBS Affiliate"
id="28460723" ppv="0" />
</tr>
<tr xsi:type="trGenericType" number="6">
<s name="KOIN" call_sign="KOIN" affiliation="CBS Affiliate"
id="28455365" ppv="0" />
</tr>
</tuneRequests>
If I use code as this to populate an array with the value from the
<tr> element:
// doc is an instance of XmlDocument
foreach (node in doc.SelectNodes(@"tuneRequests/tr") ) )
....
then use this code to populate a different array
foreach (node in doc.SelectNodes(@"tuneRequests/tr/s") ) )
....
Is it guaranteed that nodes will be returned in the same order,
top-to-bottom as they appear in the xml document for both
SelectNodes() usages?
I'd like to use this simple code to match the channel number in an
<tr> with the name, call_sign, and affiliation attributes of the
nested <s> element with these two simple foreach structures.
Thanks for any help,
Michael Hughes - Silverton, Oregon
http://wou.ath.cx/Trivia
http://wou.ath.cx/AmateurRadio