내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

How to use OR operator in xpath query language?

Avatar

Level 9

Hi All,

How to use OR operator for two different values of a JCR property?

Please help me with the syntax.

I want to get the results with two different values for cq:template property.

Thanks,

Kishore

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 3

Refer the below queries for example

/jcr:root/content//*[@pageTitle='GeoMetrixx' or @jcr:title='Geometrixx Media']

In the above query i  am searching with two properties pagetitle and jcr:title with OR operator.Even AND operator work as well.

/jcr:root/content//*[@cq:template='/libs/cq/core/content/projects/templates/creative-project-management' or @cq:template='/libs/cq/core/content/projects/templates/default'] which searches for cq:template property with 2 different values.

 

Refer the below doc for more information.

http://www.fadfish.com/anatomy-of-xpath-queries-in-aem.

https://docs.jboss.org/jbossdna/0.7/manuals/reference/html/jcr-query-and-search.html#jcr-xpath-query....

원본 게시물의 솔루션 보기

3 답변 개

Avatar

정확한 답변 작성자:
Level 3

Refer the below queries for example

/jcr:root/content//*[@pageTitle='GeoMetrixx' or @jcr:title='Geometrixx Media']

In the above query i  am searching with two properties pagetitle and jcr:title with OR operator.Even AND operator work as well.

/jcr:root/content//*[@cq:template='/libs/cq/core/content/projects/templates/creative-project-management' or @cq:template='/libs/cq/core/content/projects/templates/default'] which searches for cq:template property with 2 different values.

 

Refer the below doc for more information.

http://www.fadfish.com/anatomy-of-xpath-queries-in-aem.

https://docs.jboss.org/jbossdna/0.7/manuals/reference/html/jcr-query-and-search.html#jcr-xpath-query....

Avatar

Level 9

Thank you.

Avatar

Level 7

Hi Kishore@CQ,

If your problem has been solved, please mark it as solved.

Regards

Tuhin