XmlDocument xml = new XmlDocument();
string path = "../../ReportFiles/Building Department Report.rdl";
xml.Load(path);XmlNode dataSets = xml.SelectSingleNode("//DataSets");
XmlNode dataSets2 = xml.SelectSingleNode("/Report/DataSets");
XmlNodeList sets = xml.SelectNodes("//CommandText");
XmlNode root = xml.SelectSingleNode("/Report");以上是我写的一段代码想去读取一个报表文件(.rdl)的内容。这个报表文件也是XML格式,我想读取其中的CommandText节点内容并修改。Debug xml对象有不为空,但是SelectSingleNode方法返回的都为空。