0

Hello,

I have one problem with xml reading.

My xml file:

<TransactionDetail>
<SaleItem>
<ItemID>02900</ItemID>
<Discount Splitted="false" TypeCode="6000"> <-- New section
<LineNumber>7</LineNumber>
<Amount>0.36</Amount>
<DiscountableAmount>1.19</DiscountableAmount>
<DiscountName>RABATT</DiscountName>
<DerivationRuleID>99</DerivationRuleID>
<PromotionId>99</PromotionId>
</Discount>
</SaleItem>
</TransactionDetail>

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(); 
                    xmlDoc.Load(textReader);

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

Thanks in advance:)

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by lukasrzeznik
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.