The xpath expression boolean(//[EMAIL PROTECTED]'1']) could be used for this. Again xindice doesn't support none element results at present. I've added a bug report and unit tests for this example though.
After doing some tests this solution isn't quiet correct. It will return a true or false for each document in the collection.
3) Ability to just obtain a count of the elements qualified by an XPath query (without any documents): Given an XPath query, return somthing like: <result count="N"/>
The xpath expression count(//[EMAIL PROTECTED]'1']) could be used for this. Again xindice doesn't support none element results at present. I've added a bug report and unit tests for this example though.
Again this will return a result for every doc in the collection. It may be possible to use the result set size attribute, but at the moment this is not lazy, so there would be a big overhead.
-k.
