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:)