You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by ehsavoie <eh...@gmail.com> on 2008/06/18 15:20:46 UTC

jcr:deref problem

Hi,
I hve a xpath query using jcr:deref.
If I define the referenced node's type I get no result :
/jcr:root/kmelia60/element(*, slv:node)/jcr:deref(@slv:translations,
'slv:i18nNode')[@slv:name='Theme for Tests']
whereas if I set '*' :
/jcr:root/kmelia60/element(*, slv:node)/jcr:deref(@slv:translations,
'*')[@slv:name='Theme for Tests']
I get the correct results which are all of the expected type.

Is this a bug or am I wrong in my query ?
Emmanuel
-- 
View this message in context: http://www.nabble.com/jcr%3Aderef-problem-tp17982545p17982545.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: jcr:deref problem

Posted by ehsavoie <eh...@gmail.com>.
Yep but on the next page ;) that's why I missed it
 



Sébastien Launay wrote:
> 
> In the following page of the spec, it is written:
> 
> The dereference expression above evaluates to one or more nodes
> which has the name myapp:person. Subsequently a child node of
> each, representing the person’s address, is selected.
> 
> But, i agree that the name myapp:person is ambiguous and can be
> considered as a node type name.
> 
> -- 
> Sébastien LAUNAY
> 
> ehsavoie a écrit :
>> Thank you for your answer, the example from the spec was misleading :
>>
>> /jcr:root/myapp:myDoc/ jcr:deref(@myapp:author, 'myapp:person')/address
>>
>>
>> myapp:bart would have been clearer.
>>
>> Emmanuel
> 
> 

-- 
View this message in context: http://www.nabble.com/jcr%3Aderef-problem-tp17982545p17984915.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: jcr:deref problem

Posted by Sébastien Launay <se...@anyware-tech.com>.
In the following page of the spec, it is written:

The dereference expression above evaluates to one or more nodes
which has the name myapp:person. Subsequently a child node of
each, representing the person’s address, is selected.

But, i agree that the name myapp:person is ambiguous and can be
considered as a node type name.

-- 
Sébastien LAUNAY

ehsavoie a écrit :
> Thank you for your answer, the example from the spec was misleading :
>
> /jcr:root/myapp:myDoc/ jcr:deref(@myapp:author, 'myapp:person')/address
>
>
> myapp:bart would have been clearer.
>
> Emmanuel

Re: jcr:deref problem

Posted by ehsavoie <eh...@gmail.com>.
Thank you for your answer, the example from the spec was misleading :

/jcr:root/myapp:myDoc/ jcr:deref(@myapp:author, 'myapp:person')/address


myapp:bart would have been clearer.

Emmanuel
-- 
View this message in context: http://www.nabble.com/jcr%3Aderef-problem-tp17982545p17983877.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: jcr:deref problem

Posted by Sébastien Launay <se...@anyware-tech.com>.
Hi Emmanuel,

As defined in JSR 170 specification, the second parameter of jcr:deref()
is a node test which is a string to match the target node name.

So, it can not be used to match a node type.

But you may add a condition on jcr:primaryType :

jcr:root/kmelia60/element(*, slv:node)/jcr:deref(@slv:translations,'*')[@jcr:primaryType = 'slv:i18nNode' and @slv:name='Theme for Tests']

-- 
Sébastien LAUNAY

ehsavoie a écrit :
> Hi,
> I hve a xpath query using jcr:deref.
> If I define the referenced node's type I get no result :
> /jcr:root/kmelia60/element(*, slv:node)/jcr:deref(@slv:translations,
> 'slv:i18nNode')[@slv:name='Theme for Tests']
> whereas if I set '*' :
> /jcr:root/kmelia60/element(*, slv:node)/jcr:deref(@slv:translations,
> '*')[@slv:name='Theme for Tests']
> I get the correct results which are all of the expected type.
>
> Is this a bug or am I wrong in my query ?
> Emmanuel