http://topic.csdn.net/u/20080905/10/caea1689-4582-417a-8723-d008a3ae1a10.html?550638422
tringBuilder sb = new StringBuilder();
sb.Append(" <?xml version=/"1.0/"?> ");
sb.Append(" <root> ");
sb.Append(" <test value=/"| /"/> ");
sb.Append(" </root> ");
XmlDocument d = new XmlDocument();
try
{
d.LoadXml(sb.ToString());
MessageBox.Show("OK");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
d = null;
sb = null;
}