get a xquery option from the s9 API
Added by Anonymous about 16 years ago
Legacy ID: #5363427 Legacy Poster: filipix (filipix)
Hello, I am trying to get the value of an option declared in a xquery from either a XQueryEvaluator or whatever is available from the context of the execution of a query. I have this in my query : declare namespace toto = "http://toto.com/tutu"; declare option toto:tutu "Owner|Name"; I couldn't find any way to get the value from this option in the context of the query, is there one ? Thank you, Philippe
Replies (1)
RE: get a xquery option from the s9 API - Added by Anonymous about 16 years ago
Legacy ID: #5363542 Legacy Poster: Michael Kay (mhkay)
"declare option" when the QName is in a non-Saxon namespace is completely ignored. Saxon doesn't keep the value anywhere - it's just skipped by the parser. You can get hold of the namespaces declared in the query prolog, but it means some fairly low-level groping. You can dive down from the XQueryExecutable to an XQueryExpression; from there getStaticContext() gets you a QueryModule. Thence getNamespaceResolver() gets you a NamespaceResolver, which has methods iteratePrefixes() and getURIForPrefix(). Michael Kay
Please register to reply