List<Transactions> tl = new List<Transactions>(); Transactions t = new Transactions(); XmlNodeList details = xmldoc.GetElementsByTagName("Dtl"); foreach (XmlNode crdNode in details) { XmlNode CdtName = crdNode["Nm"]; t.Name= Name.ChildNodes.Item(0).InnerText; //If i print out t.Name, it displays all the names. XmlNode CdtAddress = crdNode["PstlAdr"]; t.Address=CdtAddress.ChildNodes.Item(0).InnerText; } XmlNodeList pmtId = xmldoc.GetElementsByTagName("ID"); foreach (XmlNode Pm in pmtId) { XmlNode transaction = Pm["Ref"]; t.TransactionReference =transaction.ChildNodes.Item(0).InnerText; } XmlNode instruct = Pm["Instr"]; t.Instruction =instruct.ChildNodes.Item(0).InnerText; } tl.Add(t); pain.transaction = tl; //pain.transaction contains a list of transaction
Transactions
List<Transactions>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)