We help IT Professionals succeed at work.

XML Parsing in compact framwork

kplonk
kplonk asked
on
Medium Priority
272 Views
Last Modified: 2010-04-16
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.
Comment
Watch Question

Not the solution you were looking for? Getting a personalized solution is easy.

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

I believe the code is XmlDocument.SelectNodes(xpathExpression).
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.