Package net.sf.saxon.query

Examples of net.sf.saxon.query.StaticQueryContext


        this.configuration = configuration;
    }

    public StaticQueryContext getStaticQueryContext() {
        if (staticQueryContext == null) {
            staticQueryContext = new StaticQueryContext(getConfiguration());
        }
        return staticQueryContext;
    }
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

                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

    public XBeansXQuery(String query, String contextVar, Integer boundary)
    {
        config = new Configuration();
        config.setDOMLevel(2);
        config.setTreeModel(net.sf.saxon.event.Builder.STANDARD_TREE);
        StaticQueryContext sc = new StaticQueryContext(config);
        this.contextVar = contextVar;
        int bdry = boundary.intValue();
        //Saxon requires external variables at the end of the prolog...
        query = (bdry == 0) ?
                "declare variable $" +
                contextVar + " external;" + query :
                query.substring(0, bdry) +
                "declare variable $" +
                contextVar + " external;" +
                query.substring(bdry);
        try
        {
            xquery = sc.compileQuery(query);
        }
        catch (TransformerException e)
        {
            throw new XmlRuntimeException(e);
        }
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

        if (config == null) {
            config = new Configuration();
        }
        config.setHostLanguage(Configuration.XQUERY);
        setConfiguration(config);
        staticEnv = new StaticQueryContext(config);
        if (getQuery() != null) {
            exp = staticEnv.compileQuery(getQuery());
            staticEnv = exp.getStaticContext();
        } else if (getResource() != null) {
            exp = staticEnv.compileQuery(getResource().getInputStream(), null);
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

            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

                    param + "] cannot be equal to null" +
                    " or the empty string.",
                    YVerificationMessage.ERROR_STATUS));
        } else {
            Configuration configuration = new Configuration();
            StaticQueryContext staticQueryContext = new StaticQueryContext();
            QueryProcessor qp = new QueryProcessor(configuration, staticQueryContext);
            try {
                qp.compileQuery(xQuery);
            } catch (XPathException e) {
                messages.add(new YVerificationMessage(this, this +
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.