/** * Take the results of a query (or any other SequenceIterator) and create * an XML document containing copies of all items in the sequence, each item wrapped in a containing * element that identifies its type * * @param iterator The values to be wrapped * @param config The Saxon configuration used to evaluate the query * @return the document containing the wrapped results * @throws XPathException if any failure occurs * @since 8.8 */ /*@Nullable*/ public static DocumentInfo wrap(SequenceIterator iterator, /*@NotNull*/ Configuration config) throws XPathException { PipelineConfiguration pipe = config.makePipelineConfiguration(); TinyBuilder builder = new TinyBuilder(pipe); builder.setStatistics(Statistics.SOURCE_DOCUMENT_STATISTICS); NamespaceReducer reducer = new NamespaceReducer(builder); ComplexContentOutputter outputter = new ComplexContentOutputter(reducer); sendWrappedSequence(iterator, outputter); return new DocumentInfo(builder.getCurrentRoot()); }
/** * Take the results of a query (or any other SequenceIterator) and create * an XML document containing copies of all items in the sequence, each item wrapped in a containing * element that identifies its type * * @param iterator The values to be wrapped * @param config The Saxon configuration used to evaluate the query * @return the document containing the wrapped results * @throws XPathException if any failure occurs * @since 8.8 */ /*@Nullable*/ public static DocumentInfo wrap(SequenceIterator iterator, /*@NotNull*/ Configuration config) throws XPathException { PipelineConfiguration pipe = config.makePipelineConfiguration(); TinyBuilder builder = new TinyBuilder(pipe); builder.setStatistics(config.getTreeStatistics().SOURCE_DOCUMENT_STATISTICS); NamespaceReducer reducer = new NamespaceReducer(builder); ComplexContentOutputter outputter = new ComplexContentOutputter(reducer); sendWrappedSequence(iterator, outputter); return new DocumentInfo(builder.getCurrentRoot()); }
/** * Takes a Receiver that expects raw output (such as might be obtained from {@link Destination#getReceiver}) * and prepends a pipeline of receivers needed to support transformation tasks, especially a * {@link ComplexContentOutputter}. * @param out a receiver expecting raw output * @return a receiver to which instructions in the stylesheet can write events. This receiver will have * been opened. * @throws XPathException if any failure occurs */ private Receiver prepareOutputReceiver(Receiver out) throws XPathException { principalResult = out; if (principalResultURI == null) { principalResultURI = out.getSystemId(); } //out = new RegularSequenceChecker(out); // uncomment for debugging //out = new TracingFilter(out); // uncomment for debugging NamespaceReducer nr = new NamespaceReducer(out); ComplexContentOutputter cco = new ComplexContentOutputter(nr); cco.setSystemId(out.getSystemId()); out = cco; if (getExecutable().createsSecondaryResult()) { // This is for the case where the stylesheet writes no output to the primary destination, // and then calls xsl:result-document with a null or empty href, in which case the xsl:result-document // output is sent to the primary output destination, but with different serialization properties. out = this.gatekeeper = new PrincipalOutputGatekeeper(this, out); } out.open(); return out; }
/** * Takes a Receiver that expects raw output (such as might be obtained from {@link Destination#getReceiver}) * and prepends a pipeline of receivers needed to support transformation tasks, especially a * {@link ComplexContentOutputter}. * @param out a receiver expecting raw output * @return a receiver to which instructions in the stylesheet can write events. This receiver will have * been opened. * @throws XPathException if any failure occurs */ private Receiver prepareOutputReceiver(Receiver out) throws XPathException { principalResult = out; if (principalResultURI == null) { principalResultURI = out.getSystemId(); } //out = new RegularSequenceChecker(out); // uncomment for debugging //out = new TracingFilter(out); // uncomment for debugging NamespaceReducer nr = new NamespaceReducer(out); ComplexContentOutputter cco = new ComplexContentOutputter(nr); cco.setSystemId(out.getSystemId()); out = cco; if (getExecutable().createsSecondaryResult()) { // This is for the case where the stylesheet writes no output to the primary destination, // and then calls xsl:result-document with a null or empty href, in which case the xsl:result-document // output is sent to the primary output destination, but with different serialization properties. out = this.gatekeeper = new PrincipalOutputGatekeeper(this, out); } out.open(); return out; }
receiver = ne; receiver = new ComplexContentOutputter(ne);
receiver = ne; receiver = new ComplexContentOutputter(ne);
/** * Take the results of a query (or any other SequenceIterator) and create * an XML document containing copies of all items in the sequence, each item wrapped in a containing * element that identifies its type * @param iterator The values to be wrapped * @param config The Saxon configuration used to evaluate the query * @return the document containing the wrapped results * @throws XPathException * @since 8.8 */ public static DocumentInfo wrap(SequenceIterator iterator, Configuration config) throws XPathException { PipelineConfiguration pipe = config.makePipelineConfiguration(); TinyBuilder builder = new TinyBuilder(); builder.setPipelineConfiguration(pipe); NamespaceReducer reducer = new NamespaceReducer(); reducer.setUnderlyingReceiver(builder); reducer.setPipelineConfiguration(pipe); ComplexContentOutputter outputter = new ComplexContentOutputter(); outputter.setPipelineConfiguration(pipe); outputter.setReceiver(reducer); sendWrappedSequence(iterator, outputter); return (DocumentInfo)builder.getCurrentRoot(); }
/** * Take the results of a query (or any other SequenceIterator) and create * an XML document containing copies of all items in the sequence, each item wrapped in a containing * element that identifies its type * @param iterator The values to be wrapped * @param config The Saxon configuration used to evaluate the query * @return the document containing the wrapped results * @throws XPathException * @since 8.8 */ public static DocumentInfo wrap(SequenceIterator iterator, Configuration config) throws XPathException { PipelineConfiguration pipe = config.makePipelineConfiguration(); TinyBuilder builder = new TinyBuilder(); builder.setPipelineConfiguration(pipe); NamespaceReducer reducer = new NamespaceReducer(); reducer.setUnderlyingReceiver(builder); reducer.setPipelineConfiguration(pipe); ComplexContentOutputter outputter = new ComplexContentOutputter(); outputter.setPipelineConfiguration(pipe); outputter.setReceiver(reducer); sendWrappedSequence(iterator, outputter); return (DocumentInfo)builder.getCurrentRoot(); }
pipe.setHostLanguage(hostLanguage); ComplexContentOutputter out = new ComplexContentOutputter(); out.setHostLanguage(hostLanguage); out.setPipelineConfiguration(pipe);
pipe.setHostLanguage(hostLanguage); ComplexContentOutputter out = new ComplexContentOutputter(); out.setHostLanguage(hostLanguage); out.setPipelineConfiguration(pipe);
return new ComplexContentOutputter(receiver);
pipe.setHostLanguage(hostLanguage); ComplexContentOutputter out = new ComplexContentOutputter(); out.setHostLanguage(hostLanguage); out.setPipelineConfiguration(pipe);
out = new ComplexContentOutputter(nr); out.setSystemId(systemId); context.setReceiver(out);
out = new ComplexContentOutputter(nr); out.setSystemId(systemId); context.setReceiver(out);
/** * Create a TinyTree to hold a document or element node. * @throws net.sf.saxon.trans.XPathException */ private void createTree() throws XPathException { builder = new TinyBuilder(); builder.setPipelineConfiguration(getPipelineConfiguration()); builder.setSystemId(getSystemId()); NamespaceReducer reducer = new NamespaceReducer(); reducer.setUnderlyingReceiver(builder); reducer.setPipelineConfiguration(getPipelineConfiguration()); ComplexContentOutputter cco = new ComplexContentOutputter(); cco.setHostLanguage(getPipelineConfiguration().getHostLanguage()); cco.setPipelineConfiguration(getPipelineConfiguration()); cco.setReceiver(reducer); outputter = cco; outputter.setSystemId(systemId); outputter.setPipelineConfiguration(getPipelineConfiguration()); outputter.open(); }
/** * Create a TinyTree to hold a document or element node. * @throws net.sf.saxon.trans.XPathException */ private void createTree() throws XPathException { PipelineConfiguration pipe = getPipelineConfiguration(); builder = pipe.getController().makeBuilder(); builder.setPipelineConfiguration(pipe); builder.setSystemId(getSystemId()); builder.setTiming(false); NamespaceReducer reducer = new NamespaceReducer(); reducer.setUnderlyingReceiver(builder); reducer.setPipelineConfiguration(getPipelineConfiguration()); ComplexContentOutputter cco = new ComplexContentOutputter(); cco.setHostLanguage(getPipelineConfiguration().getHostLanguage()); cco.setPipelineConfiguration(getPipelineConfiguration()); cco.setReceiver(reducer); outputter = cco; outputter.setSystemId(systemId); outputter.setPipelineConfiguration(getPipelineConfiguration()); outputter.open(); }
/** * Method to construct the node when this is required. * * @throws XPathException if any failure occurs */ void construct() throws XPathException { PipelineConfiguration pipe = savedXPathContext.getController().makePipelineConfiguration(); PullProvider puller = getPuller(); puller.setPipelineConfiguration(pipe); TinyBuilder builder = new TinyBuilder(); builder.setPipelineConfiguration(pipe); builder.setSystemId(pipe.getLocationProvider().getSystemId(instruction.getLocationId())); builder.setBaseURI(pipe.getLocationProvider().getSystemId(instruction.getLocationId())); NamespaceReducer reducer = new NamespaceReducer(); reducer.setUnderlyingReceiver(builder); reducer.setPipelineConfiguration(pipe); ComplexContentOutputter outputter = new ComplexContentOutputter(); outputter.setReceiver(reducer); outputter.setPipelineConfiguration(pipe); //outputter.open(); new PullPushCopier(puller, outputter).copy(); //outputter.close(); node = builder.getCurrentRoot(); }
/** * Method to construct the node when this is required. * * @throws XPathException if any failure occurs */ void construct() throws XPathException { PipelineConfiguration pipe = savedXPathContext.getController().makePipelineConfiguration(); PullProvider puller = getPuller(); puller.setPipelineConfiguration(pipe); TinyBuilder builder = new TinyBuilder(); builder.setPipelineConfiguration(pipe); builder.setSystemId(pipe.getLocationProvider().getSystemId(instruction.getLocationId())); builder.setBaseURI(pipe.getLocationProvider().getSystemId(instruction.getLocationId())); NamespaceReducer reducer = new NamespaceReducer(); reducer.setUnderlyingReceiver(builder); reducer.setPipelineConfiguration(pipe); ComplexContentOutputter outputter = new ComplexContentOutputter(); outputter.setReceiver(reducer); outputter.setPipelineConfiguration(pipe); //outputter.open(); new PullPushCopier(puller, outputter).copy(); //outputter.close(); node = builder.getCurrentRoot(); }
outputter = new ComplexContentOutputter(reducer);
outputter = new ComplexContentOutputter(reducer);