Hello folks:
I ask a question about using XPath function there
But I meet a problem about this exception:
[System.Xml.XPath.XPathException] = {"Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function."}
The xml is as follows:
<x-config>
<!--user location-->
<x-list>
<Country code="TW,UK,MY" />
<Country code="US,CA,MX" />
<Country code="IN,PR,VI,IR" />
<Country code="Others" />
</x-list>
And I use following code to retrieve matches:
XmlNode countryNode = cdnConfig.SelectSingleNode(
string.Format("x-config/x-list/Country[fn:contains(@code, {0})]", countryCode)
);
I am a newbie of XPath. Could anybody elaborate more on this and give some workaround?
Thanks a lot.