0

我想要与 SQL2 查询相同的 XPATH 查询。

SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/content/abc/def]) and ([sling:resourceType] = 'geomatrixx/components/list' )

是否有任何工具或链接可用于将 sql2 查询转换为 xpath。或任何教程,如果是,请分享链接

4

1 回答 1

2

下面是等效的 XPath 查询。

    /jcr:root/content/abc/def//element(*, cq:Page)[jcr:contains(jcr:content/@sling:resourceType, 'geometrixx/components/list')].

下面分别是xpathsql2查询之间的一些映射。取自http://docs.jboss.org/jbossdna/0.7/manuals/reference/html/jcr-query-and-search.html

      //*                                                SELECT * FROM [nt:base]
      //element(*,my:type)                               SELECT * FROM [my:type]
     //element(*,my:type)/@my:title                      SELECT [my:title] FROM [my:type]
     //element(*,my:type)/(@my:title | @my:text)         SELECT [my:title],[my:text] FROM [my:type]
    //element(*,my:type)/(@my:title union @my:text)      SELECT [my:title],[my:text] FROM [my:type]

谢谢, 巴拉吉

于 2015-06-25T15:18:01.373 回答