0

I have a following XML file to parse:

<result>
<iban>GB20ULSB98006054100029</iban>
<account>54100029</account>
<sort_code>980060</sort_code>
<bank>ULSTER BANK LTD</bank>
<branch>BELFAST CITY OFFICE 1</branch>
<bic>ULSBGB2BXXX</bic>
<address>PO BOX 232 11-16 DONEGALL SQUARE EAST </address>
<city>BT1 5UB</city>
<country>GB<country/>
<phone>028 90244112</phone>
</result>

Can anyone please tell me how to get an element 'iban'?

3
  • 1
    What had you tried so far? Commented Aug 30, 2021 at 12:02
  • Privacy? What's this "privacy" you are talking about? I am just sharing data, why should that violate someones "privacy"? Commented Aug 30, 2021 at 12:05
  • So far I have tried to parse it using the XDocument library, however I don't know how to get just a single element. Commented Aug 30, 2021 at 12:12

1 Answer 1

1

Using XDocument, you can read the elements

var xdoc = XDocument.Load("XMLFile1.xml");
var iban = xdoc.Element("result").Element("iban").Value;
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.