/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void explain(ExpressionPresenter out) { out.startElement(Token.tokens[operator]); out.emitAttribute("variable", getVariableName()); out.startSubsidiaryElement("in"); sequence.explain(out); out.endSubsidiaryElement(); out.startSubsidiaryElement("satisfies"); action.explain(out); out.endSubsidiaryElement(); out.endElement(); }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void explain(ExpressionPresenter out) { out.startElement("convertUntypedAtomic"); out.emitAttribute("to", requiredItemType.toString(out.getConfiguration().getNamePool())); out.emitAttribute("all", allConverted ? "true" : "false"); operand.explain(out); out.endElement(); } protected String displayOperator(Configuration config) {
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void explain(ExpressionPresenter destination) { destination.startElement("convertItems"); destination.emitAttribute("to", requiredItemType.toString(destination.getNamePool())); operand.explain(destination); destination.endElement(); }
/** * Export this rule as part of an exported stylesheet * * @param presenter the output handler */ public void export(ExpressionPresenter presenter) { presenter.startElement("strip.ignorable"); presenter.endElement(); } }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void export(ExpressionPresenter destination) throws XPathException { destination.startElement("supplied", this); destination.emitAttribute("slot", slotNumber + ""); destination.endElement(); }
public void explain(ExpressionPresenter out) { out.startElement("saxonContinue"); if (actualParams != null && actualParams.length > 0) { out.startSubsidiaryElement("withParams"); WithParam.displayExpressions(actualParams, out); out.endSubsidiaryElement(); } out.endElement(); }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void explain(ExpressionPresenter out) { out.startElement("for"); out.emitAttribute("variable", getVariableName()); out.emitAttribute("as", sequence.getItemType(out.getTypeHierarchy()).toString(out.getNamePool())); if (positionVariable != null) { out.emitAttribute("at", positionVariable.getVariableQName().getDisplayName()); } out.startSubsidiaryElement("in"); sequence.explain(out); out.endSubsidiaryElement(); out.startSubsidiaryElement("return"); action.explain(out); out.endSubsidiaryElement(); out.endElement(); }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied outputstream. * * @param out the expression presenter used to display the structure */ public final void explain(Logger out) { ExpressionPresenter ep = new ExpressionPresenter(getConfiguration(), out); try { export(ep); } catch (XPathException e) { ep.startElement("failure"); ep.emitAttribute("message", e.getMessage()); ep.endElement(); } ep.close(); }
/** * Diagnostic method: display a representation of the compiled query on the * selected output stream. * * @param out an ExpressionPresenter to which the XML representation of the compiled query * will be sent */ public void explain(/*@NotNull*/ ExpressionPresenter out) throws XPathException { out.startElement("query"); getExecutable().getKeyManager().exportKeys(out, null); getExecutable().explainGlobalVariables(out); mainModule.explainGlobalFunctions(out); out.startElement("body"); expression.export(out); out.endElement(); out.endElement(); out.close(); }
@Override public void export(ExpressionPresenter out) throws XPathException { ExpressionPresenter.ExportOptions options = (ExpressionPresenter.ExportOptions) out.getOptions(); out.startElement("origF"); out.emitAttribute("name", getFunctionName()); out.emitAttribute("arity", ""+getArity()); out.emitAttribute("pack", options.packageMap.get(component.getContainingPackage())+""); out.endElement(); } }
presenter.startElement("stylesheet"); presenter.namespace("fn", NamespaceConstant.FN); presenter.namespace("xs", NamespaceConstant.SCHEMA); getKeyManager().exportKeys(presenter, null); explainGlobalVariables(presenter); ruleManager.explainTemplateRules(presenter); explainNamedTemplates(presenter); presenter.startElement("accumulators"); for (Accumulator acc : getTopLevelPackage().getAccumulatorRegistry().getAllAccumulators()) { acc.export(presenter); presenter.endElement(); FunctionLibraryList libList = getFunctionLibrary(); List<FunctionLibrary> libraryList = libList.getLibraryList(); presenter.startElement("functions"); for (FunctionLibrary lib : libraryList) { if (lib instanceof ExecutableFunctionLibrary) { presenter.endElement(); presenter.endElement(); presenter.close();
public void start(int i) { out.startElement("ruleChain"); out.emitAttribute("key", out.getNamePool().getClarkName(i)); }
/** * Diagnostic print of expression structure. The abstract expression tree * 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(); }
/** * Explain the results of query compilation * * @param exp the compiled expression * @throws FileNotFoundException if the destination for the explanation doesn't exist * @throws XPathException if other failures occur */ protected void explain(XQueryExpression exp) throws FileNotFoundException, XPathException { OutputStream explainOutput; if (explainOutputFileName == null || "".equals(explainOutputFileName)) { explainOutput = System.err; } else { explainOutput = new FileOutputStream(new File(explainOutputFileName)); } SerializationProperties props = ExpressionPresenter.makeDefaultProperties(config); Receiver diag = config.getSerializerFactory().getReceiver( new StreamResult(explainOutput), props); ExpressionPresenter expressionPresenter = new ExpressionPresenter(config, diag); exp.explain(expressionPresenter); }
/** * Make a receiver, using default output properties, with serialized output going * to a specified OutputStream * @param config the Configuration * @param out the OutputStream * @return a Receiver that directs serialized output to this output stream * @throws XPathException */ public static Receiver defaultDestination(Configuration config, OutputStream out) throws XPathException { Properties props = makeDefaultProperties(); return config.getSerializerFactory().getReceiver( new StreamResult(out), config.makePipelineConfiguration(), props); }
/** * Explain the results of query compilation * * @param exp the compiled expression * @throws FileNotFoundException if the destination for the explanation doesn't exist * @throws XPathException if other failures occur */ protected void explain(XQueryExpression exp) throws FileNotFoundException, XPathException { OutputStream explainOutput; if (explainOutputFileName == null) { explainOutput = System.err; } else { explainOutput = new FileOutputStream(new File(explainOutputFileName)); } Properties props = new Properties(); props.setProperty(OutputKeys.METHOD, "xml"); props.setProperty(OutputKeys.INDENT, "yes"); 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); }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. * @param level this argument is ignored * @param out the expression presenter used to display the structure * @param config the Saxon configuration * @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 } }
SerializationProperties props = makeDefaultProperties(config); if (config.getXMLVersion() == Configuration.XML11) { if ("JS".equals(((ExportOptions) getOptions()).target)) { config.getLogger().warning("For target=JS, the SEF file will use XML 1.0, which disallows control characters"); } else {
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void explain(ExpressionPresenter out) { out.startElement("for"); out.emitAttribute("variable", getVariableName()); out.emitAttribute("as", sequence.getItemType(out.getTypeHierarchy()).toString(out.getNamePool())); if (positionVariable != null) { out.emitAttribute("at", positionVariable.getVariableQName().getDisplayName()); } out.startSubsidiaryElement("in"); sequence.explain(out); out.endSubsidiaryElement(); out.startSubsidiaryElement("return"); action.explain(out); out.endSubsidiaryElement(); out.endElement(); }
@Override public void export(ExpressionPresenter out) { out.startElement("attVal", this); out.emitAttribute("name", attributeName.getStructuredQName()); out.emitAttribute("chk", "" + requiredChecks); out.endElement(); } }