2012-05-30 65 views

回答

2

它更容易使用,而不是XPathDocument中的XDocument:

XDocument doc = XDocument.Parse(s); 
0

您應該能夠通過字符串轉換成流,然後使用XPathDocument(Stream) constructor來實現:

string xmlFile; // TODO get string 
byte[] byteArray = Encoding.ASCII.GetBytes(xmlFile); 
MemoryStream stream = new MemoryStream(byteArray); 
var Doc = new XPathDocument(stream); 
相關問題