Link to home
Start Free TrialLog in
Avatar of asmyatt
asmyatt

asked on

Need Help Reading an XML Document

I have this XML document and I need to read it, but I'm having trouble getting the nested information such as:

I want to read the <location> information into an array list for each Byte compare type ex ("office", "Quark")

<ByteCompareList>
    <ByteCompareType>
      <name>Office</name>
      <ByteCompareLocations>
        <Location>
          <at>43</at>
          <value>135</value>
        </Location>
        <Location>
          <at>44</at>
          <value>134</value>
        </Location>
        <returnFiletype>Access</returnFiletype>
      </ByteCompareLocations>
      <ByteCompareLocations>
        <Location>
          <at>32</at>
          <value>243</value>
        </Location>
        <Location>
          <at>33</at>
          <value>255</value>
        </Location>
        <returnFiletype>Word</returnFiletype>
      </ByteCompareLocations>
    </ByteCompareType>
    <ByteCompareType>
      <name>Quark</name>
      <ByteCompareLocations>
        <Location>
          <at>66</at>
          <value>143</value>
        </Location>
        <Location>
          <at>68</at>
          <value>98</value>
        </Location>
        <returnFiletype>Quark Template</returnFiletype>
      </ByteCompareLocations>
    </ByteCompareType>
  </ByteCompareList>

any help is greatly appreciated.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
why do you wanna read that data again in a different logical format?
xmldocument manages the data with an internal tree.
so you would get into memory problems if you have large xml files.
you can work with the xmlnodelist, which references every location nodes you need.