1

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

2 Answers 2

1

AMT is node name Ccy is node attribute

Sign up to request clarification or add additional context in comments.

1 Comment

I got it, the syntax would be : fundoElement2.ChildNodes.Item(1).ChildNodes.Item(0).Attributes.getNamedItem("Ccy").Text Tks a lot
1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.