I have an xml node that looks like <slot highcount="20" lowcount="10" />
I’ve tried the following xpath expression:
XmlNode node = xdoc.SelectSingleNode("slot[@lowcount>=12] && slot[@highcount <=12]");
but I get an invalid token error and I don’t have enough experience with this to know what I’m doing wrong. Any ideas?
You need to use the “and” operator – there is no “&&” operator in XPath. I think something like this should work:
EDIT: This is the correct syntax, but to select the node specified in the question, we need to flip around the operators like the second snippet below. I’m leaving the original code sample in for context, so that the comment thread makes sense: