1

我正在编写一个独立程序来获取所有具有某个后代节点的页面节点。Ex - 如果结构是这样的 -

- parent
   - jcr:content
      -node1
      -node2
      -node3
         -node4

我希望父节点基于节点 4 的名称为“test”的条件。

我写了以下查询 -

SELECT parent.* 
FROM [cq:Page] AS parent 
     INNER JOIN [cq:PageContent] AS child ON
         ISCHILDNODE(child, parent) 
     INNER JOIN [nt:unstructured] AS scndchild ON 
         ISDESCENDANTNODE(scndchild, child) 
WHERE ISDESCENDANTNODE(parent, '/content/folder/en') AND
      LOCALNAME(scndchild) LIKE '%test%' AND
      scndchild.[sling:resourceType] = 'something'

此查询在 CRXde 中运行良好,但是当我通过 Eclipse 运行它时,查询返回 0 个节点。

我是否需要在 Eclipse 中添加一些东西或做不同的事情?有没有办法编写嵌套查询?还是等效的 XPath 查询?提前致谢!

4

0 回答 0