Link to home
Start Free TrialLog in
Avatar of kplonk
kplonk

asked on

XML Parsing in compact framwork

Hi,

If I have a XML file like this:

<?xml version="1.0" encoding="utf-8" ?>
<orders>
      <order>
            <number>80000001</number>
            <custName>Test Cust</custName>
            <items>
                  <item>
                        <id>35000019</id>
                        <received>no</received>
                        <code>10095</code>
                  </item>
                  <item>
                        <id>35000020</id>
                        <received>no</received>
                        <code>10011</code>
                  </item>
                  
            </items>
      </order>
</orders>

If c# compact framework what is the best way to loop over the items table for a given order. I have the order table in a foreach loop so for each order I want to loop over the items table?

Thanks Kieran.
ASKER CERTIFIED SOLUTION
Avatar of navalarya1982
navalarya1982

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
Avatar of mmarksbury
mmarksbury

You could use XPATH to select all the ITEM nodes under a particular ORDER node.  

I believe the code is XmlDocument.SelectNodes(xpathExpression).