Hi WH,
Xindice does not implement aggregate expressions across multiple Resources contained in a Collection. The XPath expression is evaluated against each Resource in the Collection and all resulting Resources are returned.
You can perform certain aggregations yourself in your application. For positional aggregation such as suggested by (//data)[position()=last()], be aware that the order of returned Resources is arbitrary (not guaranteed by contract as e.g. order of insertion AFAIK).
Thus, you would probably need to perform a sort of some kind before choosing the "last" for a meaningful result.
-Terry
[EMAIL PROTECTED] wrote:
Hi Terry,
No, even the testbed confirms my suspicions. The following expression on the testbed : (//data)[position()=last()]
is what I want - only a single result. But running this through Xindice it gives me a ResourceSet containing 3 resources.
Seems the syntax is translated a bit ambiguously for some reason.
I've not been able to solve the problem.
WH
Terry Rosenbaum wrote:
Hi WH,
If, for example, you have 3 <Id> elements in your collection, the correct result would be 3 Resources each containing one of the 3 <Id> elements.
Your XPath syntax is not doing what you desire.
Using an XPath testbed may help. One is available
on the web here: http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm
-Terry
[EMAIL PROTECTED] wrote:
Hi all,
Given the XPath : (//Id)[last()]
Xindice always seems to ignore the predicate portion, and it returns the results as if I had written :
//Id
Is this a problem with Xindice, XPath or my syntax? I'm trying to return the last Id element in my database.
I'd appreciate any help.
Thanks WH
