jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Querying for multi-valued properties with XPath
Date Wed, 07 Nov 2007 09:14:32 GMT
Fabián Mandelbaum wrote:
> Hello list,
> I was wondering if I can use XPath queries to query for properties
> with multiple values in a similar way than using XPath for single-valued
> properties. For example, I have a myns:keys property having
> a list of Strings, one String for each key(word), thus myns:keys is
> multi-valued.
> Now, if //*[@myns:single_valued_property = 'some_value'] is the XPath that
> returns the node set having the myns:single_valued_property set to
> some_value; which would be the XPath that returns the node set having
> the myns:multival_property set to, say: val1, val2, val3 ?

you can simply write:

//*[@myns:multival_property = 'val1' and @myns:multival_property = 'val2' and 
@myns:multival_property = 'val2']

however, this will return nodes with a myns:multival_property, which contain *at 
least* the three values.


View raw message