StaticQueryContext
Added by Anonymous over 19 years ago
Legacy ID: #3033713 Legacy Poster: vguiraud (vguiraud)
Hello, Why doesn't a StaticQueryContext compile more than one query ? Since Saxon 8.3, an exception occurs when you use the same StaticQueryContext because it isn't reusable without calling the method reset(). I want to use the same StaticQueryProcessor to compile more than one query because I want to share functions, parameters (names and values) and namespaces between queries. In fact, I don't want to redeclare functions, parameters and namespaces How can I do this ? Thanks for your help.
Replies (4)
Please register to reply
RE: StaticQueryContext - Added by Anonymous over 19 years ago
Legacy ID: #3033793 Legacy Poster: Michael Kay (mhkay)
The reason this isn't allowed is that the StaticQueryContext gets updated as the query prolog is compiled, so after compiling one query its state contains a mixture of things that were set by the user from the API, and by the query compiler from the query prolog. Ideally the query processor should take a copy of the static context supplied by the user and should not modify the original object, allowing the original to be reused for multiple queries. But until this happens, the error check is there because of the unpredictable effects that could occur if a StaticQueryContext is reused after it has been modified by the query processor. Michael Kay http://www.saxonica.com/
RE: StaticQueryContext - Added by Anonymous over 19 years ago
Legacy ID: #3036324 Legacy Poster: Michael Kay (mhkay)
I have implemented changes for the next release so StaticQueryContext will become reusable. Michael Kay
RE: StaticQueryContext - Added by Anonymous over 19 years ago
Legacy ID: #3036601 Legacy Poster: vguiraud (vguiraud)
Thank you for your answer. When will the next release be available ? Is it Saxon 8.4 ?
RE: StaticQueryContext - Added by Anonymous over 19 years ago
Legacy ID: #3036677 Legacy Poster: Michael Kay (mhkay)
I don't yet have a plan for the next functionality release. It depends on whether I decide there are sufficiently serious bugs in 8.3 that an 8.3.1 maintenance release takes priority. Michael Kay
Please register to reply