You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by kakikaaa <ka...@hotmail.fr> on 2019/06/25 09:54:44 UTC

Querying leaf nodes with XPath

Hi everyone, 

I am trying to query only leaf nodes using XPath. 
For that I have the query : "/jcr:root//*[not(*)]"

It doesn't seam to be tolerate in the subset of XPath in Jackrabbit.

I wanted to know if there is another solution than setting a property ? 

Thanks, 

Karim



--
Sent from: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-Users-f510167.html

Re: Querying leaf nodes with XPath

Posted by Thomas Mueller <mu...@adobe.com.INVALID>.
Hi,

Sorry for the delay... It is tricky. I found a solution for SQL-2:

    select [a].* from [nt:base] as [a] 
    left outer join [nt:base] as [b] 
    on ischildnode([b], [a]) 
    where isdescendantnode([a], '/content') 
    and [b].[jcr:primaryType] is null

Regards,
Thomas

On 25.06.19, 12:21, "kakikaaa" <ka...@hotmail.fr> wrote:

    Hi everyone, 
    
    I am trying to query only leaf nodes using XPath. 
    For that I have the query : "/jcr:root//*[not(*)]"
    
    It doesn't seam to be tolerate in the subset of XPath in Jackrabbit.
    
    I wanted to know if there is another solution than setting a property ? 
    
    Thanks, 
    
    Karim
    
    
    
    --
    Sent from: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-Users-f510167.html