I tested /project/pages/page[@completed='n'][not(text())=''] at http://www.mizar.dk/XPath/Default.aspx with success but the xpath expression below doesn't work in C#. How do I re-write the xpath statement so I can use .Evaluate to return a empty node-set in C#?

string xpath = "/project/pages/page[@completed='n'][not(text())='']";
bool not_finished = (bool)xd.CreateNavigator().Evaluate(xpath);
<project>
  <pages>
    <page id="1" completed="y">one</page>
    <page id="2" completed="y">two</page>
    <page id="3" completed="y">three</page>
    <page id="4" completed="y">four</page>
    <page id="5" completed="y">five</page>
    <page id="6" completed="y">six</page>
  </pages>
</project>

Evalute method evaluates the string representing an XPath expression and returns the typed result (number, Boolean, string, or node set). Use the XPathNodeIterator to iterate over a set of nodes.

XPathNodeIterator b= (XPathNodeIterator) navigator.Evaluate(xpath);
while(b.MoveNext()) {
  Console.Write(b.Current);
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.