Package net.sf.saxon.query

Examples of net.sf.saxon.query.StaticQueryContext


            LOG.debug("Initializing XQueryBuilder {}", this);
            configuration = new Configuration();
            configuration.setHostLanguage(Configuration.XQUERY);
            configuration.setStripsWhiteSpace(isStripsAllWhiteSpace() ? Whitespace.ALL : Whitespace.IGNORABLE);

            staticQueryContext = new StaticQueryContext(getConfiguration());
            if (moduleURIResolver != null) {
                staticQueryContext.setModuleURIResolver(moduleURIResolver);
            }

            Set<Map.Entry<String, String>> entries = namespacePrefixes.entrySet();
View Full Code Here


        props.setProperty(OutputKeys.INDENT, "yes");
   
    XQueryExpression exp = implementation.getCompiledExpressionsCache().get(xqExpression);
    if(exp == null) {
      config = new Configuration();
      StaticQueryContext sqc = new StaticQueryContext(config);
      exp = sqc.compileQuery(xqExpression);
      implementation.getCompiledExpressionsCache().put(xqExpression, exp);
    } else {
      config = exp.getStaticContext().getConfiguration();
    }
   
View Full Code Here

    xqueryImplementation.setXqExpression(xqExpression);
   
    xqExpression += "\r\n<dummy></dummy>";
   
    Configuration config = new Configuration();
        StaticQueryContext sqc = new StaticQueryContext(config);
        XQueryExpression exp = null;
    try {
      exp = sqc.compileQuery(xqExpression);
    } catch (XPathException e) {
      throw new ContributionResolveException(e);
    }
   
    if(exp == null) {
View Full Code Here

  /**
   * From the compiled xquery expression get all namespaces and see if they
   * are services, references or properties declaraions
   */
  private void introspectServicesAndReferences(XQueryImplementation xqueryImplementation, XQueryExpression exp) throws ClassNotFoundException, InvalidInterfaceException {
    StaticQueryContext compiledSqc = exp.getStaticContext();
        NamespaceResolver namespaceResolver = compiledSqc.getNamespaceResolver();
        Iterator declaredPrefixesIterator = namespaceResolver.iteratePrefixes();
        while(declaredPrefixesIterator.hasNext()) {
          String prefix = (String)declaredPrefixesIterator.next();
          String uri = namespaceResolver.getURIForPrefix(prefix, false);
          if(uri.startsWith(SCA_SERVICE_PREFIX)) {
View Full Code Here

            LOG.debug("Initializing XQueryBuilder {}", this);
            configuration = new Configuration();
            configuration.setHostLanguage(Configuration.XQUERY);
            configuration.setStripsWhiteSpace(isStripsAllWhiteSpace() ? Whitespace.ALL : Whitespace.IGNORABLE);

            staticQueryContext = new StaticQueryContext(getConfiguration());
            Set<Map.Entry<String, String>> entries = namespacePrefixes.entrySet();
            for (Map.Entry<String, String> entry : entries) {
                String prefix = entry.getKey();
                String uri = entry.getValue();
                staticQueryContext.declareNamespace(prefix, uri);
View Full Code Here

                LOG.debug("Initializing XQueryBuilder " + this);
            }
            configuration = new Configuration();
            configuration.setHostLanguage(Configuration.XQUERY);

            staticQueryContext = new StaticQueryContext(getConfiguration());
            Set<Map.Entry<String, String>> entries = namespacePrefixes.entrySet();
            for (Map.Entry<String, String> entry : entries) {
                String prefix = entry.getKey();
                String uri = entry.getValue();
                staticQueryContext.declareNamespace(prefix, uri);
View Full Code Here

            LOG.debug("Initializing XQueryBuilder {}", this);
            configuration = new Configuration();
            configuration.setHostLanguage(Configuration.XQUERY);
            configuration.setStripsWhiteSpace(isStripsAllWhiteSpace() ? Whitespace.ALL : Whitespace.IGNORABLE);

            staticQueryContext = new StaticQueryContext(getConfiguration());
            if (moduleURIResolver != null) {
                staticQueryContext.setModuleURIResolver(moduleURIResolver);
            }

            Set<Map.Entry<String, String>> entries = namespacePrefixes.entrySet();
View Full Code Here

                LOG.debug("Initializing XQueryBuilder " + this);
            }
            configuration = new Configuration();
            configuration.setHostLanguage(Configuration.XQUERY);

            staticQueryContext = new StaticQueryContext(getConfiguration());
            Set<Map.Entry<String, String>> entries = namespacePrefixes.entrySet();
            for (Map.Entry<String, String> entry : entries) {
                String prefix = entry.getKey();
                String uri = entry.getValue();
                staticQueryContext.declareNamespace(prefix, uri);
View Full Code Here

        this.configuration = configuration;
    }

    public StaticQueryContext getStaticQueryContext() {
        if (staticQueryContext == null) {
            staticQueryContext = new StaticQueryContext(getConfiguration());
        }
        return staticQueryContext;
    }
View Full Code Here

     * @return the QueryModule object representing the loaded library module
     */

    private QueryModule loadModule() throws XPathException {
        // Create a dummy main query module and compile it
        StaticQueryContext sqc = new StaticQueryContext(getConfiguration());
        sqc.setExecutable(getExecutable());
        sqc.setBaseURI(getBaseURI());
        String mainModule = "import module namespace m = \"" + moduleURI + "\" at \"" + href + "\"; ()";
        XQueryExpression exp = sqc.compileQuery(mainModule);
        return exp.getStaticContext();
    }
View Full Code Here

TOP

Related Classes of net.sf.saxon.query.StaticQueryContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.