Package net.sf.saxon.trace

Examples of net.sf.saxon.trace.ExpressionPresenter


                        NodeInfo optElement = getChildElement(testCase, optimizationNT);
                        if (optElement != null) {
                            String explain = optElement.getAttributeValue(explainAtt);
                            if ("true".equals(explain) || "1".equals(explain)) {
                                ExpressionPresenter presenter = new ExpressionPresenter(saConfig);
                                xqe.explain(presenter);
                                presenter.close();
                            }
                            String assertion = optElement.getAttributeValue(assertAtt);
                            if (assertion != null) {
                                TinyBuilder builder = new TinyBuilder();
                                builder.setPipelineConfiguration(saConfig.makePipelineConfiguration());
                                ExpressionPresenter presenter = new ExpressionPresenter(saConfig, builder);
                                xqe.explain(presenter);
                                presenter.close();
                                NodeInfo expressionTree = builder.getCurrentRoot();
                                XPathEvaluator xpe = new XPathEvaluator(saConfig);
                                XPathExpression exp = xpe.createExpression(assertion);
                                try {
                                    Boolean bv = (Boolean)exp.evaluateSingle(expressionTree);
View Full Code Here


        }

        if (assertion != null) {
            TinyBuilder builder = new TinyBuilder();
            builder.setPipelineConfiguration(config.makePipelineConfiguration());
            ExpressionPresenter presenter = new ExpressionPresenter(config, builder);
            ((PreparedStylesheet)sheet).explain(presenter);
            presenter.close();
            NodeInfo expressionTree = builder.getCurrentRoot();
            XPathEvaluator xpe = new XPathEvaluator(config);
            XPathExpression exp = xpe.createExpression(assertion);
            Boolean bv = (Boolean)exp.evaluateSingle(expressionTree);
            if (!bv.booleanValue()) {
                System.err.println("** Optimization assertion failed");
                presenter = new ExpressionPresenter(config);
                ((PreparedStylesheet)sheet).explain(presenter);
                presenter.close();
                throw new XPathException("Expected optimization not performed");
            }
        }


View Full Code Here

     * is written to the supplied outputstream.
     * @param out the expression presenter used to display the structure
     */

    public final void explain(OutputStream out) {
        ExpressionPresenter ep = new ExpressionPresenter(getExecutable().getConfiguration(), out);
        explain(ep);
        ep.close();
    }
View Full Code Here

        Properties props = ExpressionPresenter.makeDefaultProperties();
        Receiver diag = config.getSerializerFactory().getReceiver(
                new StreamResult(explainOutput),
                config.makePipelineConfiguration(),
                props);
        ExpressionPresenter expressionPresenter = new ExpressionPresenter(config, diag);
        exp.explain(expressionPresenter);
    }
View Full Code Here

                        Properties props = ExpressionPresenter.makeDefaultProperties();
                        Receiver diag = config.getSerializerFactory().getReceiver(
                                new StreamResult(explainOutput),
                                config.makePipelineConfiguration(),
                                props);
                        ExpressionPresenter expressionPresenter = new ExpressionPresenter(config, diag);
                        sheet.explain(expressionPresenter);
                        expressionPresenter.close();
                    }

                }

                if (wholeDirectory) {
View Full Code Here

     * @since 9.1
     */

    public void explain(Destination destination) throws SaxonApiException {
        Configuration config = processor.getUnderlyingConfiguration();
        pss.explain(new ExpressionPresenter(config, destination.getReceiver(config)));
    }
View Full Code Here

        props.setProperty(SaxonOutputKeys.INDENT_SPACES, "2");
        Receiver diag = config.getSerializerFactory().getReceiver(
                new StreamResult(explainOutput),
                config.makePipelineConfiguration(),
                props);
        ExpressionPresenter expressionPresenter = new ExpressionPresenter(config, diag);
        exp.explain(expressionPresenter);
    }
View Full Code Here

                        props.setProperty(SaxonOutputKeys.INDENT_SPACES, "2");
                        Receiver diag = config.getSerializerFactory().getReceiver(
                                new StreamResult(explainOutput),
                                config.makePipelineConfiguration(),
                                props);
                        ExpressionPresenter expressionPresenter = new ExpressionPresenter(config, diag);
                        sheet.explain(expressionPresenter);
                        expressionPresenter.close();
                    }

                }

                if (wholeDirectory) {
View Full Code Here

     * @deprecated since 9.0 - use the explain method
     */

    public void display(int level, PrintStream out, Configuration config) {
        try {
            ExpressionPresenter ep = new ExpressionPresenter(config,
                    ExpressionPresenter.defaultDestination(config, out));
            explain(ep);
        } catch (XPathException err) {
            // ignore the exception
        }
View Full Code Here

     * is written to the supplied outputstream.
     * @param out the expression presenter used to display the structure
     */

    public final void explain(OutputStream out) {
        ExpressionPresenter ep = new ExpressionPresenter(getExecutable().getConfiguration(), out);
        explain(ep);
        ep.close();
    }
View Full Code Here

TOP

Related Classes of net.sf.saxon.trace.ExpressionPresenter

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.