I am somewhat new to extracting data from an XML document in .Net.
My document looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<RMA-Standard>
<IncomeData>
<NetSales>64000000</NetSales>
<COGS>80.0</COGS>
<ProfitBeforeTax>6.0</ProfitBeforeTax>
</IncomeData>
</RMA-Standard>
I tried to do the following:
Dim _lNode As XmlNode
Dim _sNodeValue As String
Dim root As XmlElement = doc.DocumentElement
_sNodeValue = doc.SelectSingleNode("RMA-Standard\IncomeData\NetSales").InnerText()
The error I get is that the node does not exist. Basically, all I want to do is get the value out of that node.
Is my syntax wrong? I have seen some examples with a 'descendant'. Not sure what that is.
Thanks.
Norton