[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XPath (and other W3C drafts)
Eliot Kimber wrote: > At the risk of seeming dim or lazy or both, can someone > explain the implications of these new features? Using 'let', you can bind a variable directly in XPath. There is of course no impact on XQuery. In XSLT, that is sometimes convenient to be able to write a single XPath expression without requiring to split it into several expressions or to write a stylesheet function. And that's important too for other host languages. Using first-class function items, you can manipulate functions as items. For instance, you can pass a function as parameter to another function. Think for instance about a sorting function, taking a function item parameter to compare two items: sort( $seq as items()*, $comparator as function($lhs as item(), $rhs as item()) ) You can call it like: sort((2, 1, 3), my:less-than#2) or even like: sort( (2, 1, 3), function ($lhs as xs:integer, $rhs as xs:integer) as xs:boolean { if ( $ascending ) then $lhs le $rhs else $lhs gt $rhs } ) That allow one to write higher-order functions (such a function that takes a function item as param or return a function item as result). I hope that will boost writing of more general-purpose libraries for XSLT and XQuery... Well that's just what comes directly in mind, others can maybe give more (and more precise) use cases. Regards, -- Florent Georges http://www.fgeorges.org/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|