How to find nodes without specific child node? | Community
Skip to main content
Level 4
October 16, 2015
Solved

How to find nodes without specific child node?

  • October 16, 2015
  • 5 replies
  • 3574 views

Hello,

Can someone help me with query in CQ?
How can I find nodes without specific child node (e.g. jcr:content)?

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

You cant do with xpath. Refer [1] published just now to find page that are missing jcr:content.

[1]   http://aemfaq.blogspot.com/2013/12/how-to-find-missing-content-nodes-in.html

5 replies

Level 8
October 16, 2015

I am not sure I understand the question. Can you expand on your use case, what kind of nodes are you searching for - components within a page? 

Level 4
October 16, 2015

I have nodes under /content/myapp/en:

/content/myapp/en/jcr:content
/content/myapp/en/item
/content/myapp/en/item/jcr:content
/content/myapp/en/item2
/content/myapp/en/item2/jcr:content
/content/myapp/en/item3
/content/myapp/en/item4

I want to write xpath query to find nodes without jcr:content.
As result I want to see:
/content/myapp/en/item3
/content/myapp/en/item4

smacdonald2008
Level 10
October 16, 2015

Why not use JCR-SQL? 

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

You cant do with xpath. Refer [1] published just now to find page that are missing jcr:content.

[1]   http://aemfaq.blogspot.com/2013/12/how-to-find-missing-content-nodes-in.html

Level 4
October 16, 2015

It doesn't matter. Could you show please, how to do it using JCR-SQL?