EDN Admin
Well-known member
The following code works, but Id prefer to use XDocument instead of XmlDocument.
How do I perform an XPath query using system.xml.Linq.XDocument? Bing searching suggested I use the descendants method of XDocuments, but I could not find a function to accept an XPath expression!
<div style="color:black; background-color:white
<pre> <span style="color:blue var xdoc = XDocument.Parse(xmls);
<span style="color:blue var doc = <span style="color:blue new System.Xml.XmlDocument();
doc.LoadXml(xmls);
Console.WriteLine(xmls);
<span style="color:green //var d = xdoc.Descendants();
<span style="color:blue var ticketId = doc.SelectSingleNode(<span style="color:#a31515 "/XMLLog/XMLLogDetail/@TicketId");
Console.WriteLine(<span style="color:#a31515 "ticket id=" + ticketId.InnerText);
[/code]
<
siegfried heintze<br/>
View the full article
How do I perform an XPath query using system.xml.Linq.XDocument? Bing searching suggested I use the descendants method of XDocuments, but I could not find a function to accept an XPath expression!
<div style="color:black; background-color:white
<pre> <span style="color:blue var xdoc = XDocument.Parse(xmls);
<span style="color:blue var doc = <span style="color:blue new System.Xml.XmlDocument();
doc.LoadXml(xmls);
Console.WriteLine(xmls);
<span style="color:green //var d = xdoc.Descendants();
<span style="color:blue var ticketId = doc.SelectSingleNode(<span style="color:#a31515 "/XMLLog/XMLLogDetail/@TicketId");
Console.WriteLine(<span style="color:#a31515 "ticket id=" + ticketId.InnerText);
[/code]
<
siegfried heintze<br/>
View the full article