Subject: XPath 2.0: Collection-Valued Expressions (Was: Re: [xsl] XQuery 1.0 and XPath 2.0 Functions and Operators Version 1.0) From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx> Date: Fri, 7 Sep 2001 17:27:57 +0100 |
Hi Jim, One thing that seems to be missing from the F&O WD is support for XPath 2.0 Requirement 2.5 "Should Support Aggregation Functions Over Collection-Valued Expressions". There are frequently cases where it would be useful to evaluate an expression to use for calculating sums, maxima, minima, averages, sort values and so on. We currently have to use case-specific templates or something along the lines of Dimitre's generic templates to do this kind of thing. Tied in with this is the oft-requested functionality of being able to dynamically evaluate a string as an XPath. Put these together, and an expression data type along the lines of the one in Saxon seems like a good idea. Examples of how I'd like to see it working: Work out the total payable on a purchase order: xf:sum(Order/Item, xf:expression('@Price * @Quantity')) Find the row with the most cells in it: xf:max(tr, xf:expression('count(td)')) Sort a sequence of strings by their length: xf:sort('fubar foo foobar', xf:expression('string-length(.)')) Is there a reason that this requirement isn't covered in the F&O document? Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XQuery 1.0 and XPath 2.0 , Jim Melton | Thread | Re: XPath 2.0: Collection-Valued Ex, Jim Melton |
RE: [xsl] XPath help, Michael Kay | Date | XPath 2.0: Conditional Expression (, Jeni Tennison |
Month |