Christian,
Thanks as always. I've updated from source and can confirm it works great now. We're using the initial context pretty extensively in our system. We set it through the API by using a custom class that wraps QueryContext and re-implements several of the methods including compile(). We do that so that we can have a little more control over the query process (like setting the context and defining new custom collections that span multiple databases).
Dave
-----Original Message----- From: Christian GrĂ¼n [mailto:christian.gruen@gmail.com] Sent: Friday, June 18, 2010 12:50 PM To: Dave Glick Cc: basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] XQuery FLOWR and Context
Hi Dave,
Query: let $v := . return $v Context: document, Result: The entire document (as expected) Context <b>, Result: The entire document (was expecting the <b> element and all its content!)
This has been fixed as well (some performance optimizations lead to an erroneous decision to ignore the current context). Please check out the latest sources.
It is interesting to see that this feature is actually used. You can use the BaseX command "cs" to change the context reference outside the GUI for new queries, as e.g. shown here:
basex -c "create db doc.xml; cs //text(); xquery ."
Hope this helps, Christian