William Brogden wrote:I can think of ways in which an XPath expression could clearly be "invalid" and you could detect this from the XSD.
I am guessing that the business requirement is to determine whether the XPath expression would return a non-empty list of nodes. After all the XPath expression "/fruit/banana" can be evaluated in the context of any XML document and usually it will return zero nodes. But it isn't "invalid" in any formal sense.
But my guess could be wrong. That's why I asked for clarification.