문제

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>
도움이 되었습니까?

해결책

Just add an attribute:

 new XElement("InstdAmt", new XAttribute("Ccy", "Eur"), "1000");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top