下面是等價的XPath查詢。
/jcr:root/content/abc/def//element(*, cq:Page)[jcr:contains(jcr:content/@sling:resourceType, 'geometrixx/components/list')].
下面是一些映射從http://docs.jboss.org/jbossdna/0.7/manuals/reference/html/jcr-query-and-search.html respectively.Taken和之間的XPath SQL2查詢。
//* 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]
感謝, 巴拉吉
我所知道的唯一方法是使用代碼。如果使用com.day.cq.search.Query類,則會在調用方法getResult()後在IDE的調試器中看到使用的xpath查詢... – Thomas