var elmnt = new XElement("div", new XAttribute("id", "myDiv"), new XRaw("<span id='content'>hello world</span>") );
public class XRaw : XText
{
public XRaw(string text):base(text)
{
}
public XRaw(XText text): base(text)
{
}
public override void WriteTo(System.Xml.XmlWriter writer)
{
writer.WriteRaw(this.Value);
}
}
随笔记录,来源:https://www.it1352.com/249055.html