Hi All.
I want xpath query for the above XML.. please find the line with Bold Blue color.
I need value for path="file://c:/programs/manufacturer/icons/device.ico" />
I tried to do this but getting exception (Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function. ). Can Some one help me out with XPATH query ASAP.
Thanks in Advance.


Manikavelu VelayuthamRank #413 · 6K reputationPosted Jan 23, 2011, 11:47 PM EST
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("test.xml");
XmlNode conStringNode = xmlDoc.SelectSingleNode("/RKT/IOInfo/IODeviceTypes/RKT:IODeviceType/RKT:DeviceIcon");
string strPath = conStringNode.Attributes["path"].Value.ToString();
Rajendra TripathyRank #1,822 · 814 reputationPosted Jan 23, 2011, 11:58 PM EST
thanks for your reply .. But I tried with this and getting error (Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.)..
In that XML u can see some Namespaces are there..
Manikavelu VelayuthamRank #413 · 6K reputationPosted Jan 24, 2011, 12:12 AM EST
XmlDocument xemaildoc = new XmlDocument();
xemaildoc.Load("xemaildoc.xml");
XmlNamespaceManager man = new XmlNamespaceManager(xemaildoc.NameTable);
man.AddNamespace("xsl", "http://www.w3.org/1999/XSL/Transform");
XmlNode titlenode = xemaildoc.SelectSingleNode("/xsl:stylesheet/xsl:template[@match='/']/title", man);
string subjecttext = titlenode.InnerText;