Extract values from XML node

kurniawan

New Member
I have an xml file that I have to read it and extract values from nodes in to some variables, I came across a node that I don't know how to extract data, this is the node:\[code\]<QuantityInIssueUnit uom="KO">288.000</QuantityInIssueUnit> \[/code\]So i have to extract KO and 288.00 and pass it to variables, i tried this:\[code\]if (!dr_art_line.Table.Columns.Contains("QuantityInIssueUnit") || dr_art_line["QuantityInIssueUnit"].ToString().Length <= 0) { QuantityInIssueUnit = 0; } else { QuantityInIssueUnit = Convert.ToDecimal(dr_art_line["QuantityInIssueUnit"]); {\[/code\]and this:\[code\]if (!dr_art_line.Table.Columns.Contains("QuantityInIssueUnit uom") || dr_art_line["QuantityInIssueUnit uom"].ToString().Length <= 0) { QuantityInIssueUnit_uom = 0; } else { QuantityInIssueUnit_uom = Convert.ToDecimal(dr_art_line["QuantityInIssueUnit uom"]); }\[/code\]But every time the QuantityInIssueUnit is 0, I know I'm doing somethig wrong in reading,what is the propper way to read this kind of node?Thanks!
 
Back
Top