XPathNavigator.Evaluate returning incorrect value?
- by Eric
I'm expecting this code to return true but it doesn't ? What am I missing here.
string xml = @"<data><e id=""NUM_CPUS"">1</e><e id=""ACE_PRESENT"">1</e></data>";
XPathDocument doc = new XPathDocument(new StringReader(xml));
string expr = "(id('NUM_CPUS'))>=1 and (id('ACE_PRESENT'))=1";
XPathNavigator nav = doc.CreateNavigator();
XPathExpression query = nav.Compile(expr);
object result = nav.Evaluate(query);
bool b = bool.Parse(result.ToString());
if (!b)
throw new Exception("Should be true");