My question is, does the XPathSelectElement method support a where clause in the xpath query?
Here is an example of what I am trying to do:
var element = coreXml.XPathSelectElement(configuration/system.serviceModel/client/endpoint[@name='SomeService']);
When I run this I am returned ‘null’ based on the follow xml:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<client>
<endpoint address="http://localhost:40901/SomeService/" binding="basicHttpBinding" contract="SomeContract" name="SomeService"/>
</client>
</system.serviceModel>
</configuration>
Regards.
I can’t reproduce the problem, I saved your XML samples as “XMLFile2.xml” in a C# console project, then corrected your code sample to wrap the XPath expression passed to XPathSelectElement in double quotes and made the following code sample:
It outputs “False”.
So something in your real code is different.