Is there any C# function which could be used to escape and un-escape a string, which could be used to fill in the content of an XML element?
And how to unescape?
【解决方案】
public { XmlDocument doc = new XmlNode node = doc.CreateElement("root"); node.InnerText = unescaped; return node.InnerXml; }
public { XmlDocument doc = new XmlNode node = doc.CreateElement("root"); node.InnerXml = escaped; return node.InnerText; } |