I have one problem with xml reading.

My xml file:

<Discount Splitted="false" TypeCode="6000"> <-- New section

How I can get "ItemID" when "Amount" > 0 ?

My code:

XmlReader textReader = XmlReader.Create(new StreamReader(@"C:\TEMP\Working\EJR\"+ejrName, Encoding.GetEncoding("ISO-8859-1")));

                    XmlDocument xmlDoc = new XmlDocument(); 

                    XmlNodeList xnList = xmlDoc.SelectNodes("/TransactionDetail/SaleItem");
                    foreach (XmlNode xn in xnList)
                        string item = xn["ItemID"].InnerText;

Thanks in advance:)

Recommended Answers

All 3 Replies

Read the Amount node value to a double and then do the foreach IF Amount > 0.00

Yes I know. But I have different level between Amount and ItemID. Can you write me a code how to do that ?

Have somebody any ideas ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.