Steven Huey wrote:
I tried searching the archives and wiki but couldn't find any examples of XPath or SQL queries for searching the contents of multiple-value string properties. I have a set of nodes, each with a property that can contain multiple string values and I'd like to be able to quickly find all the nodes that have a given string as one of their values.

See the JSR 170 specification sections:
- 6.4.2.5 Multi-value Properties
- 6.6.4.10 Searching Multi-value Properties

Searching for multi-valued properties is basically the same as searching for single-valued properties.

//[EMAIL PROTECTED] = 'bar']

will return all nodes with a property called foo and a value 'bar'. Both single- and multi-valued matches are returned. The = is called a general comparison.

If you are only interested in nodes with a single value for property foo:

//[EMAIL PROTECTED] eq 'bar']

will return all nodes with a property foo and a single value 'bar'. E.g. nodes with a multi-valued property foo and values {'foo', 'bar'} will not be returned. But the query will still return matches for multi-valued properties if foo just contains the one value {'bar'}. The eq operator is called a value comparison.

In most cases you should be ok with the general comparison operator.

regards
 marcel

Reply via email to