Ming Yu [http://community.jboss.org/people/my600080] created the discussion

"JCR xpath query"

To view the discussion, visit: http://community.jboss.org/message/634669#634669

--------------------------------------------------------------
Hi, I have a question regarding a jcr xpath query. Here is an example similar 
to the one on jboss's website:



| //element(*,my:type)[./*/*/@id=1 and ./*/*/@name='test'] |

This xpath query is equivillent to the following sql select statement:

| SELECT * FROM [my:type] 
JOIN [nt:base] as nodeSet1 ON ISCHILDNODE(nodeSet1,[my:type]) 
JOIN [nt:base] as nodeSet2 ON ISCHILDNODE(nodeSet2,nodeSet1) 
WHERE nodeSet2.id = 1 and nodeSet2.name = 'test' |


What I want to achieve is to get all entries from my:type that have a two level 
down childnode with id = 1 AND name = 'test'. So, these two constraints have to 
be met on any ONE child node.

But this query will actually do this: any two level down childnode contains id 
= 1 or name = 'test'.  The childnode can be different childnode as long as one 
meets id = 1 and the other one meets name = 'test'.

How can I achive my goal with xpath query?

Thanks a lot!

Ming
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/634669#634669]

Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to