开发者

Why is XPathNavigator case sensitive?

开发者 https://www.devze.com 2022-12-14 17:50 出处:网络
XPathNavigator navigator = 开发者_Python百科myApp.XML.CreateNavigator(); XPathExpression expression = navigator.Compile(\"true\"); //works
XPathNavigator navigator = 开发者_Python百科myApp.XML.CreateNavigator();
XPathExpression expression = navigator.Compile("true"); //works
XPathExpression expression = navigator.Compile("true or true"); //works
XPathExpression expression = navigator.Compile("true OR true) //'System.Xml.XPath.XPathException'


Because XPath operators are case-sensitive.


"or" is a keyword/operator in XPath, and as such is only going to be interpreted correctly in its lowercase form. Is that what you were looking for? XML and XPath are case-sensitive in general, but the keyword issue is the specific reason you're seeing the error you indicated in your post.

0

精彩评论

暂无评论...
验证码 换一张
取 消