Reputation: 11
I have the following XML file content:
<HldgVal>
<Amt Ccy="BRL">25641.94</Amt>
<Sgn>true</Sgn>
The "BRL" indicated is the Currency for the amount 25641.94, however, when I try to read the tag Amt Ccy="BRL" in order to get the currency symbol, I just get the node name "AMT" instead of Amt Ccy="BRL".
I am using the following code :
MoedaCaixa = fundoElement2.ChildNodes.Item(1).FirstChild.nodeName
Does anyone knows how to get the full name "Amt Ccy="BRL"" so that I can read the currency?
Thanks in advance
Upvotes: 1
Views: 1109
Reputation: 11
AMT is the node name and Ccy is the node attribute. What you want is the node attribute value. Try this:
MoedaCaixa = fundoElement2.Attributes.getNamedItem("BRL").Text
Upvotes: 1