Question

I am using

new XElement("InstdAmt", "1000")

However, I would like to add the currency in the first tag as shown below. How could I do this please?

Only using the first tag

new XElement("InstdAmt Ccy=EUR", "1000")

so I can get this result

<InstdAmt Ccy="EUR">1000</InstdAmt>
Was it helpful?

Solution

Just add an attribute:

 new XElement("InstdAmt", new XAttribute("Ccy", "Eur"), "1000");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top