开发者

Using Linq to XML, is it possible to store " in an attribute?

开发者 https://www.devze.com 2023-02-01 03:37 出处:网络
Using Linq to XML, is it possible to store &q开发者_JS百科uot; in an attribute. So if I look at the xml source, it will show "

Using Linq to XML, is it possible to store &q开发者_JS百科uot; in an attribute.

So if I look at the xml source, it will show "

What I've tried so far, is

new XAttribute("AttribName", "'")

But that just stores '

If I try

new XAttribute("AttribName", """)

Then it will store "


Your first version is an apostrophe, not a quotation mark. Try this:

new XAttribute("name", "\"");
0

精彩评论

暂无评论...
验证码 换一张
取 消