/** * 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); }
/** * 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); }
/** * 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); }
/** * 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 */ /*@Nullable*/ public static Receiver defaultDestination(/*@NotNull*/ Configuration config, Logger out) throws XPathException { SerializationProperties props = makeDefaultProperties(config); return config.getSerializerFactory().getReceiver(out.asStreamResult(), props); }
/** * 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 */ /*@Nullable*/ public static Receiver defaultDestination(/*@NotNull*/ Configuration config, Logger out) throws XPathException { SerializationProperties props = makeDefaultProperties(config); return config.getSerializerFactory().getReceiver(out.asStreamResult(), props); }
/** * Make an ExpressionPresenter that writes indented output to a specified output stream * @param config the Saxon configuration * @param out the output stream */ public ExpressionPresenter(Configuration config, OutputStream out) { Properties props = makeDefaultProperties(); try { receiver = config.getSerializerFactory().getReceiver( new StreamResult(out), config.makePipelineConfiguration(), props); } catch (XPathException err) { err.printStackTrace(); throw new InternalError(err.getMessage()); } this.config = config; try { receiver.open(); receiver.startDocument(0); } catch (XPathException err) { err.printStackTrace(); throw new InternalError(err.getMessage()); } }
/** * Make an ExpressionPresenter that writes indented output to a specified output stream * @param config the Saxon configuration * @param out the output stream */ public ExpressionPresenter(Configuration config, OutputStream out) { Properties props = makeDefaultProperties(); try { receiver = config.getSerializerFactory().getReceiver( new StreamResult(out), config.makePipelineConfiguration(), props); } catch (XPathException err) { err.printStackTrace(); throw new InternalError(err.getMessage()); } this.config = config; try { receiver.open(); receiver.startDocument(0); } catch (XPathException err) { err.printStackTrace(); throw new InternalError(err.getMessage()); } }
SerializationProperties props = makeDefaultProperties(config); if (config.getXMLVersion() == Configuration.XML11) { if ("JS".equals(((ExportOptions) getOptions()).target)) {
SerializationProperties props = makeDefaultProperties(config); if (config.getXMLVersion() == Configuration.XML11) { if ("JS".equals(((ExportOptions) getOptions()).target)) {