使用 OR 语句的 Jackrabbit XPath 查询的问题
我的 Jackrabbit 2.2 应用程序中有以下 Xpath 查询:
//crms:publications/*/*[
@crms:publication-security = '28862' OR
@crms:publication-security='23459' OR
@crms:publication-security='23489'
]
执行时导致以下异常
javax.jcr.query.InvalidQueryException: 第 1 行第 73 列有词汇错误。 遇到:“@”(64),之后:“”为 语句: for $v in //crms:publications/*/*[@crms:publication-security='28862' 或 @crms:publication-security='23459' 或 @crms:publication-security='23489'] 返回$v
但如果我在没有 OR 的情况下运行以下查询,它运行得很好:
//crms:publications/*/*[@crms:publication-security='28862']
这可能是显而易见的事情,但如果我对我做错的事情有任何指导,我将不胜感激,
谢谢
大卫
I have the following Xpath Query in my Jackrabbit 2.2 application:
//crms:publications/*/*[
@crms:publication-security = '28862' OR
@crms:publication-security='23459' OR
@crms:publication-security='23489'
]
which is causing the following exception when it is executed
javax.jcr.query.InvalidQueryException:
Lexical error at line 1, column 73.
Encountered: "@" (64), after : "" for
statement: for $v in
//crms:publications/*/*[@crms:publication-security='28862' OR @crms:publication-security='23459'
OR @crms:publication-security='23489']
return $v
but if I run the following query without the OR's it runs fine:
//crms:publications/*/*[@crms:publication-security='28862']
It is probably something obvious but any guidance would be appreciated on what I am doing wrong
Thanks
David
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,这是显而易见的。 XPath 区分大小写,因此“OR”应该是“or”
It was obvious unfortunately. XPath is case sensitive so 'OR' should have been 'or'