我想查詢一個XMLDocument和接收錯誤:如何訪問XmlDocument對象的Root屬性?
var query = from date in xmlDoc.Root.Elements("Serial")
的誤差約爲Root
。
我完整的代碼看起來是這樣的:
private async void Button_Click_1(object sender, RoutedEventArgs e)
{
StorageFile xmlFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("Content1.xml");
XmlDocument xmlDoc;
xmlDoc = await XmlDocument.LoadFromFileAsync(xmlFile);
System.Xml.Linq.XDocument duc = System.Xml.Linq.XDocument.Parse(xmlDoc.GetXml());
var query = from Date in xmlDoc.Root.Elements("Serial")
where Date.Attribute("No").Value == "1";
}
我如何可以訪問XmlDocument
對象的Root
財產?
請更精確 –
XML解析需要:使用的System.Xml – Gerry
我使用的System.Xml還是其示值誤差 – maha