jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Hagedorn <nachteilh...@gmx.de>
Subject Re: Why should nt:resource be a child of nt:file
Date Mon, 11 Oct 2010 09:36:59 GMT
Hi Sascha,

I'm not sure, but I think you only need to descent into the jcr:content 
child of nt:file:

//element(*, nt:file)[@myapp:comment='someComment' and 
jcr:contains(./jcr:content,'someText')]

Regards,
Stefan

On 11.10.2010 10:15, Sascha.Theves@innovations.de wrote:
> Hi all,
>
>
>
> I have a question regarding the structure of my repository. I followed
> the suggestions and modelled my files of type "nt:file" and the
> jcr:content property of type "nt:resource". The jcr:content node is a
> child of nt:file. I have also other properties of type string on the
> nt:file node, for example myapp:comment. Now I want to search the
> repository for all "files" (that is the file itself and its` content)
> that have myapp:comment='someComment' and contain some text in the
> content of the nt:resource node. My XPath query looks like:
>
>
>
> //element(*, nt:base)[@myapp:comment='someComment' and jcr:contains(.,
> 'someText')]
>
>
>
> The problem is that the result set is always empty. The result set is
> empty because we do not have nodes that have both - a comment attribute
> AND a content. My question is: How can I restructure my query so I get
> the nodes that have comment AND some text in the content? Or why is the
> jcr:content node of nt:file a child node instead of a property? If it
> were a property I would not have that problem.
>
>
>
> Any ideas would be helpful.
>
>
>
> Thanks in advance,
>
>
>
> Sascha Theves
>
>
>
>


Mime
View raw message