I have an xml file structured thusly:

xml Code:
  1. <?xml version="1.0" encoding="us-ascii" ?>
  2. <signaturelist>
  3.     <signature>
  4.         <name>Final Fantasy VI Advance</name>
  5.         <editor>FFVIAdvance.dll</editor>
  6.         <sram>
  7.             <start>7936</start>
  8.             <length>32</length>
  9.             <string>46494E414C2046414E544153592056492020202020414456414E434520202020</string>
  10.         </sram>
  11.         <vba>
  12.             <start>4</start>
  13.             <length>16</length>
  14.             <string>464636414456414E43450000425A3645</string>
  15.         </vba>
  16.     </signature>
  17.     <signature>
  18.         <name>Castlevania: Circle of the Moon</name>
  19.         <editor>CastlvaniaCotM.dll</editor>
  20.         <sram>
  21.             <start>0</start>
  22.             <length>11</length>
  23.             <string>44524143554C4120414742</string>
  24.         </sram>
  25.         <vba>
  26.             <start>4</start>
  27.             <length>16</length>
  28.             <string>44524143554C41204147423141414D45</string>
  29.         </vba>
  30.     </signature>
  31. </signaturelist>

If the structure is wrong then let me know, I made it using Expression Web.

I have looked at examples of parsing xml files and have the following code:

vb.net Code:
  1. Dim m_xmld As New Xml.XmlDocument
  2.         m_xmld.LoadXml(My.Resources.signatures)
  3.  
  4.         Dim start_nodes As Xml.XmlNodeList = m_xmld.GetElementsByTagName("start")
  5.         Dim length_nodes As Xml.XmlNodeList = m_xmld.GetElementsByTagName("length")
  6.         Dim string_nodes As Xml.XmlNodeList = m_xmld.GetElementsByTagName("string")
  7.  
  8.         Dim i As Integer = 0
  9.         Do
  10.             If Read.HexString(CInt(start_nodes(i).Value), CInt(length_nodes(i).Value)) = string_nodes(i).Value Then
  11. ' extra code here
  12. i += 1
  13. End If
  14. Loop While i < start_nodes.Count

basically the HexString function will read bytes from my internal buffer starting at "start" and reading "length" bytes. It then returns a string containing the bytes read. If it is equal to "string" then the correct signature is read.

My problem:
I cannot figure out how to know if I am in the "sram" or "vba" node or even which signature I am reading from (so I can get the value of "name" and "editor"). I could count the number of signatures I have read through but they will not be in any concrete order.

Previously, I have used a line delimited text file with each signature on it's own line. Each property was seperated by a "|" character and I would split the line and check the signature like that.

I wanted to instead use xml. Thanks, Troy.