/** * Invoke the stylesheet by applying templates to a supplied input sequence, returning the raw results. * as an {@link XdmValue}. The invocation uses any initial mode set using {@link #setInitialMode(QName)}, * and any template parameters set using {@link #setInitialTemplateParameters(java.util.Map, boolean)}. * * @param selection the initial value to which templates are to be applied (equivalent to the <code>select</code> * attribute of <code>xsl:apply-templates</code>) * @return the raw result of applying templates to the supplied selection value, without wrapping in * a document node or serializing the result. If there is more that one item in the selection, the result * is the concatenation of the results of applying templates to each item in turn. * @throws SaxonApiException if the transformation fails */ public XdmValue applyTemplates(XdmValue selection) throws SaxonApiException { Objects.requireNonNull(selection); RawDestination raw = new RawDestination(); applyTemplates(selection, raw); return raw.getXdmValue(); }
/** * Invoke the stylesheet by applying templates to a supplied input sequence, returning the raw results. * as an {@link XdmValue}. The invocation uses any initial mode set using {@link #setInitialMode(QName)}, * and any template parameters set using {@link #setInitialTemplateParameters(java.util.Map, boolean)}. * * @param selection the initial value to which templates are to be applied (equivalent to the <code>select</code> * attribute of <code>xsl:apply-templates</code>) * @return the raw result of applying templates to the supplied selection value, without wrapping in * a document node or serializing the result. If there is more that one item in the selection, the result * is the concatenation of the results of applying templates to each item in turn. * @throws SaxonApiException if the transformation fails */ public XdmValue applyTemplates(XdmValue selection) throws SaxonApiException { Objects.requireNonNull(selection); RawDestination raw = new RawDestination(); applyTemplates(selection, raw); return raw.getXdmValue(); }
/** * Invoke the stylesheet by applying templates to a supplied Source document, returning the raw results * as an {@link XdmValue}. The invocation uses any initial mode set using {@link #setInitialMode(QName)}, * and any template parameters set using {@link #setInitialTemplateParameters(java.util.Map, boolean)}. * * @param source the source document. For streamed processing, this must be a SAXSource or StreamSource. * <p>Note: supplying a <code>DOMSource</code> is allowed, but is much less efficient than using a * <code>StreamSource</code> or <code>SAXSource</code> and leaving Saxon to build the tree in its own * internal format. To apply more than one transformation to the same source document, the source document * tree can be pre-built using a {@link DocumentBuilder}.</p> * @return the raw result of processing the supplied Source using the selected template rule, without * wrapping the returned sequence in a document node * @throws SaxonApiException if the transformation fails */ public XdmValue applyTemplates(Source source) throws SaxonApiException { Objects.requireNonNull(source); RawDestination raw = new RawDestination(); applyTemplates(source, raw); return raw.getXdmValue(); }
/** * Invoke the stylesheet by applying templates to a supplied Source document, returning the raw results * as an {@link XdmValue}. The invocation uses any initial mode set using {@link #setInitialMode(QName)}, * and any template parameters set using {@link #setInitialTemplateParameters(java.util.Map, boolean)}. * * @param source the source document. For streamed processing, this must be a SAXSource or StreamSource. * <p>Note: supplying a <code>DOMSource</code> is allowed, but is much less efficient than using a * <code>StreamSource</code> or <code>SAXSource</code> and leaving Saxon to build the tree in its own * internal format. To apply more than one transformation to the same source document, the source document * tree can be pre-built using a {@link DocumentBuilder}.</p> * @return the raw result of processing the supplied Source using the selected template rule, without * wrapping the returned sequence in a document node * @throws SaxonApiException if the transformation fails */ public XdmValue applyTemplates(Source source) throws SaxonApiException { Objects.requireNonNull(source); RawDestination raw = new RawDestination(); applyTemplates(source, raw); return raw.getXdmValue(); }
transformer.applyTemplates(source, result); } catch (SaxonApiException err) { throw new SAXException(err);
transformer.applyTemplates(source, result); } catch (SaxonApiException err) { throw new SAXException(err);
transformer.applyTemplates(sourceDoc, serializer);
transformer.applyTemplates(sourceDoc, serializer);
transformer.applyTemplates(source, serializer); } else { XdmValue result = transformer.applyTemplates(source); serializer.serializeXdmValue(result);
transformer.applyTemplates(source, serializer); } else { XdmValue result = transformer.applyTemplates(source); serializer.serializeXdmValue(result);
xsltTransformer.applyTemplates(xmlSource, destination);
xsltTransformer.applyTemplates(xmlSource, destination);
StreamSource stream = new StreamSource(sourceLocation); if (transformer.getUnderlyingController().getInitialMode().isDeclaredStreamable()) { transformer.applyTemplates(stream, destination); } else { transformer.transform(stream,destination); transformer.applyTemplates(initialMatchSelection, destination); result = deliverer.getPrimaryResult();
StreamSource stream = new StreamSource(sourceLocation); if (transformer.getUnderlyingController().getInitialMode().isDeclaredStreamable()) { transformer.applyTemplates(stream, destination); } else { transformer.transform(stream,destination); transformer.applyTemplates(initialMatchSelection, destination); result = deliverer.getPrimaryResult();