jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabián Mandelbaum <fmandelb...@gmail.com>
Subject Re: Querying for multi-valued properties with XPath
Date Wed, 07 Nov 2007 12:18:14 GMT
Marcel Reutegger escribió:
> 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.
> regards
>  marcel
Well... that's one of the uses indeed. Return nodes that have all values
set (think about multi-keyword search). I didn't think about the 'and'
operator... gross omission on my side... thanks for throwing some light
on this.

View raw message