简体   繁体   中英

Why is XPathNavigator case sensitive?

XPathNavigator navigator = 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'

因为XPath运算符区分大小写。

"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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM