Hi Alex, That particular "function" in MarkLogic is not actually a function at all, but a "functional form" - that is, an expression that looks like a function. You're right that the third argument is evaluated, possibly multiple times, under a different context than function arguments would normally be executed under.
John On 03/03/11 17:22, Alexander Boyd wrote: > I’m running the following code snippet in CQ: > > cts:highlight( > > <bogus>This is a test sentence to test this out.</bogus>, > > "test", > > <searchHit>{fn:upper-case($cts:text)}</searchHit> > > ) > > This results in the following, which makes sense as per the API > documentation for cts:highlight: > > <bogus>This is a <searchHit>TEST</searchHit> sentence to > <searchHit>TEST</searchHit> this out.</bogus> > > What’s confusing me about this is that the evaluation of the third > argument to cts:highlight appears to be deferred until cts:highlight is > actually running, since $cts:text doesn’t appear to exist outside of a > call to cts:highlight. Is this a defined part of XQuery or is this > MarkLogic-specific? > > Thanks, > > Alex -- John Snelson, Senior Engineer http://twitter.com/jpcs MarkLogic Corporation http://www.marklogic.com _______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general