[xquery-talk] Extend and override
Michael Kay
mike at saxonica.com
Wed Aug 10 10:30:16 PDT 2011
On 10/08/2011 17:02, Tim Finney wrote:
> Hi Everyone,
>
> I'm interested to know how to do extension and override.
With XSLT ;-)
Seriously, I did a consultancy assignment with a big XQuery user and
this was a major hassle. We invented some kind of machinery for building
a query using variant versions of a library module to handle different
scenarios, but we had to decide up front which version of the query to
use in each run-time situation so it wasn't much fun.
>
> Can it be done in an elegant and bomb proof way? I'd like to know
> whether any of you know about good general approaches in this area.
>
In XQuery 3.0 we have dynamic function items and some of us still have
hopes that we might get maps. (If maps aren't in the standard, they will
certainly be in many implementations). With a map of function items you
have something akin to a weakly-typed object as in Javascript, and you
can use it to do dynamic despatch. It doesn't provide all that you are
asking for, but at least there is no longer a brick wall.
Michael Kay
Saxonica
More information about the talk
mailing list