Hi,
Thanks for the link. based on that, I tried
/jcr:root/some//test - This query is without using the "element".
/jcr:root/some//element(test, ocm:page) - This one will probably work only
for the test folder.
Both the above queries work.
However, on using "element" in the query,i.e.,
jcr:root/some//test/element(*, ocm:page) or
/jcr:root/some//test//element(*, ocm:page)
it doesnt work.
Marcel Reutegger wrote:
Kaizer wrote:
Thanks for the reply. I dont have any nodes under test but as you
mentioned,
"jackrabbit also allows you to use the descendant-or-self axis anywhere
else
in the path", so if i want to get the "test node", which would be the
self-axis, the query /jcr:root//some/test//element(*, my:type) should
work.
At least that was my understanding from the spec.
See http://www.w3.org/TR/xpath20/#abbrev. the example there says:
"Each non-initial occurrence of // is effectively replaced by
/descendant-or-self::node()/ during processing of a path expression. For
example, div1//para is short for
child::div1/descendant-or-self::node()/child::para and so will select all
para
descendants of div1 children."
regards
marcel