Thank's for your quick answer but it's seems doesn't work. I speak about the not function of course. The other part (/aRootNode/subNode//*) is working expect that the root of a repo is always jcr:root and the rootNode is of course under this node. That was a mistake in my first post but like it's something i understand i want to make it available to everyone.
I thought of prepare an extract what I want to do in a small archive and make it available to anyone that would like to look after it. Do you think it could be interesting ? I should open instead a jira ? Thanks Nicolas -----Message d'origine----- De : Alexander Klimetschek [mailto:[email protected]] Envoyé : mardi 23 novembre 2010 17:08 À : [email protected] Objet : Re: xpath query of subnode On 23.11.10 16:46, "Nicolas Betheuil" <[email protected]> wrote: >I have the following structure for my default schéma >/aRootNode/subNode/onePath/myInterestingNode/conditions[2]/@someHelpffulAt >tributes >/aRootNode/subNode/otherVeryDifferentPath/myOtherInterestingNode/ >(without condition) > >One of my case make this query >/aRootNode/subNode/* You want to do /aRootNode/subNode//* as you have intermediate steps such as "onePath" or "otherVeryDifferentPath" in your example. >[(conditions/@property!='propName') or (conditions/@property='propName' >and conditions/@operator='eq' and conditions/@expectedValue=true) or >(count(conditions)=0)] >But the count(conditions)=0 doesn't work. Worse, ever it's in an or >condition, all is false and nothing is returned. count() is not supported in JCR xpath, which only implements a subset of Xpath 1.0. For more see the spec starting at section 6.6: http://www.day.com/specs/jcr/1.0/index.html But not(conditions) should do the trick. Regards, Alex -- Alexander Klimetschek Developer // Adobe (Day) // Berlin - Basel
