public Collection<String> prepareXQuery(String query, XQStaticContext ctx) throws XQException { setStaticContext(sqc, ctx); try { final XQueryExpression exp = sqc.compileQuery(query); if (logger.isTraceEnabled()) { logger.trace("prepareXQuery; query: \n{}", explainQuery(exp)); } Set<String> result = new HashSet<>(); Iterator<GlobalVariable> itr = exp.getMainModule().getModuleVariables(); while (itr.hasNext()) { result.add(itr.next().getVariableQName().getClarkName()); } return result; } catch (XPathException ex) { logger.error("prepareXQuery.error: ", ex); throw new XQException(ex.getMessage()); } }
sqc.compileLibrary(connection.getInputStream(), "utf-8"); XQueryExpression xqe = sqc.compileQuery("import module namespace f='" + ns + "'; ."); QueryModule qm = xqe.getMainModule(); fl = qm.getGlobalFunctionLibrary();
sqc.compileLibrary(connection.getInputStream(), "utf-8"); XQueryExpression xqe = sqc.compileQuery("import module namespace f='" + ns + "'; ."); QueryModule qm = xqe.getMainModule(); fl = qm.getGlobalFunctionLibrary();
final UserFunction fn = expression.getMainModule().getUserDefinedFunction( function.getNamespaceURI(), function.getLocalName(), arguments.length); if (fn == null) {
final UserFunction fn = expression.getMainModule().getUserDefinedFunction( function.getNamespaceURI(), function.getLocalName(), arguments.length); if (fn == null) {