开发者

.Net's XmlElement doesn't encode apos and quot?

class C {
  [XmlElement("txt")]
  public string Txt {get; set;}
}

When serializing the above with ' " & < >, the output is ' " &amp; &lt; &gt;

Why 开发者_如何学Goisn't ' and " encoded to &apos; and &quot;?


Quotes must be encoded within attributes, its not required when inside an XML element text.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜