Hi list,
I have been doing some tests with "//" (descendant-or-self) axis, and i
think is not interpreted correctly by Jacrabbit Query Builder.
A query with this axis returns only "descendant" nodes instead of
"descendant-or-self" nodes. For example with this piece of code:
Node myTopNode =
rootNode.addNode("myTopNode");
myTopNode.addNode("subNode");
myTopNode.addNode("subNode");
rootNode.save();
String query = "//myTopNode//*";
//Should find all the 3 nodes: myTopNode and 2 subnodes.
QueryManager qm = currentSession.getWorkspace().getQueryManager();
Query q = qm.createQuery(query, Query.XPATH);
QueryResult qr = q.execute();
NodeIterator nodes = qr.getNodes();
assertEquals(3, nodes.getSize());
the test fails because it only finds two nodes instead of three. Is this
a bug? Am I misunderstanding "//" axis?
Regards,
Alvaro
--
Alvaro Gonzalez de Paz
Germinus XXI
http://www.germinus.com
Avda. de Manoteras, 44. 2ยช planta.
28050 - Madrid (Spain)
Tel (+34) 91 296 12 34
Fax (+34) 91 296 12 30