I may be wrong, but I don't think it is possible with XPath, since it has only
one selector (i.e. brakets) in any query.
You may want to use a join operation with JQOM or SQL2.
Or make two queries and intersect the nodes yourself.
F
Le 2011-05-26 à 6:12 AM, Ashok a écrit :
> Hi,
>
> I am using Jackrabbit 2.0
>
> I am trying the following Xpath query to fetch the attribute information
> from my repository:
> ==============
> .
> .
> .
> QueryManager queryManager = session.getWorkspace().getQueryManager();
> Query q = queryManager.createQuery(
> "/jcr:root/configRoot/" + deviceId + "//element(" + nodeName + ")",
> Query.XPATH);
> QueryResult result = q.execute();
> NodeIterator nr = result.getNodes();
> .
> .
> .
> ===============
>
> Everything works fine here. Note that in the above query "deviceId" and
> "nodeName" are input parameters for this method.
>
> I want to know how we can specify multiple "deviceId" and multiple
> "nodeName" in the above query. Usually "deviceId" and "nodeName" will be a
> ArrayList. I definitely do not want to do a "*" of "deviceId" and "nodeName"
> since it select all the repository results.
>
> Any suggestions?
>
> --
> Cheers,
> Ashok
> +91-9600117508