/** * Simple interface to load a schema document * * @param absoluteURI the absolute URI of the location of the schema document */ public void loadSchema(String absoluteURI) throws SchemaException { readSchema(makePipelineConfiguration(), "", absoluteURI, null); }
/** * Simple interface to load a schema document * * @param absoluteURI the absolute URI of the location of the schema document * @throws net.sf.saxon.type.SchemaException if the schema document at the given location cannot be read or is invalid */ public void loadSchema(String absoluteURI) throws SchemaException { readSchema(makePipelineConfiguration(), "", absoluteURI, null); }
/** * Simple interface to load a schema document * * @param absoluteURI the absolute URI of the location of the schema document * @throws net.sf.saxon.type.SchemaException if the schema document at the given location cannot be read or is invalid */ public void loadSchema(String absoluteURI) throws SchemaException { readSchema(makePipelineConfiguration(), "", absoluteURI, null); }
/** * Simple interface to load a schema document * @param absoluteURI the absolute URI of the location of the schema document */ public void loadSchema(String absoluteURI) throws SchemaException { readSchema(makePipelineConfiguration(), "", absoluteURI, null); }
/** * Static method to build a document from any kind of Source object. If the source * is already in the form of a tree, it is wrapped as required. * <p><i>The preferred way to construct a document tree from a Source object is to * use the method {@link Configuration#buildDocument}.</i></p> * @param source Any javax.xml.transform.Source object * @param stripper A stripper object, if whitespace text nodes are to be stripped; * otherwise null. * @param config The Configuration object * @return the NodeInfo of the start node in the resulting document object. */ public static NodeInfo build(Source source, Stripper stripper, Configuration config) throws XPathException { return build(source, stripper, config.makePipelineConfiguration()); }
/** * Static method to build a document from any kind of Source object. If the source * is already in the form of a tree, it is wrapped as required. * <p><i>The preferred way to construct a document tree from a Source object is to * use the method {@link Configuration#buildDocument}.</i></p> * @param source Any javax.xml.transform.Source object * @param stripper A stripper object, if whitespace text nodes are to be stripped; * otherwise null. * @param config The Configuration object * @return the NodeInfo of the start node in the resulting document object. */ public static NodeInfo build(Source source, Stripper stripper, Configuration config) throws XPathException { return build(source, stripper, config.makePipelineConfiguration()); }
/** * Static method to build a document from any kind of Source object. If the source * is already in the form of a tree, it is wrapped as required. * <p><i>The preferred way to construct a document tree from a Source object is to * use the method {@link Configuration#buildDocument}.</i></p> * @param source Any javax.xml.transform.Source object * @param stripper A stripper object, if whitespace text nodes are to be stripped; * otherwise null. * @param config The Configuration object * @return the NodeInfo of the start node in the resulting document object. */ public static NodeInfo build(Source source, Stripper stripper, Configuration config) throws XPathException { return build(source, stripper, config.makePipelineConfiguration()); }
/** * Return a Receiver. Saxon calls this method to obtain a Receiver, to which it then sends * a sequence of events representing the content of an XML document. * * @param config The Saxon configuration. This is supplied so that the destination can * use information from the configuration (for example, a reference to the name pool) * to construct or configure the returned Receiver. * @return the Receiver to which events are to be sent. * @throws SaxonApiException * if the Receiver cannot be created */ public Receiver getReceiver(Configuration config) throws SaxonApiException { domWriter.setPipelineConfiguration(config.makePipelineConfiguration()); return domWriter; } }
/** * Get a Builder suitable for building nodes that can be attached to this document. * * @return a new TreeBuilder */ /*@NotNull*/ public Builder newBuilder() { LinkedTreeBuilder builder = new LinkedTreeBuilder(config.makePipelineConfiguration()); builder.setAllocateSequenceNumbers(false); return builder; }
/** * Create a IdentityTransformerHandler and initialise variables. The constructor is protected, because * the Filter should be created using newTransformerHandler() in the SAXTransformerFactory * class * * @param controller the Controller for this transformation */ protected IdentityTransformerHandler(IdentityTransformer controller) { this.controller = controller; setPipelineConfiguration(controller.getConfiguration().makePipelineConfiguration()); }
/** * Create a IdentityTransformerHandler and initialise variables. The constructor is protected, because * the Filter should be created using newTransformerHandler() in the SAXTransformerFactory * class * * @param controller the Controller for this transformation */ protected IdentityTransformerHandler(IdentityTransformer controller) { this.controller = controller; setPipelineConfiguration(controller.getConfiguration().makePipelineConfiguration()); }
/** * Get a Builder suitable for building nodes that can be attached to this document. * * @return a new TreeBuilder */ /*@NotNull*/ public Builder newBuilder() { LinkedTreeBuilder builder = new LinkedTreeBuilder(config.makePipelineConfiguration()); builder.setAllocateSequenceNumbers(false); return builder; }
/** * Get a Receiver that wraps a given Result object. Saxon calls this method to construct * a serialization pipeline. The method can be overridden in a subclass; alternatively, the * subclass can override the various methods used to instantiate components of the serialization * pipeline. * <p>This version of the method calls {@link #getReceiver(Result, SerializationProperties, PipelineConfiguration)} * supplying default output properties, and a {@code PipelineConfiguration} newly constructed using * {@link Configuration#makePipelineConfiguration()}.</p> * * @param result The final destination of the serialized output. Usually a StreamResult, * but other kinds of Result are possible. * @throws XPathException if a serializer cannot be created */ public Receiver getReceiver(Result result) throws XPathException { return getReceiver(result, new SerializationProperties(), config.makePipelineConfiguration()); }
/** * 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); }
private static NodeInfo sourceToNode(Source src, Configuration cfg) throws XPathException { // Saxon extension to the XQJ specification PipelineConfiguration pipe = cfg.makePipelineConfiguration(); TinyBuilder b = new TinyBuilder(pipe); b.setStatistics(Statistics.SOURCE_DOCUMENT_STATISTICS); Sender.send(src, b, null); NodeInfo node = b.getCurrentRoot(); b.reset(); return node; }
/** * Get an XMLStreamWriter that can be used for writing application-generated XML * to be output via this serializer. * * @return a newly constructed XMLStreamWriter that pipes events into this Serializer * @throws SaxonApiException if any other failure occurs * @since 9.3 */ public StreamWriterToReceiver getXMLStreamWriter() throws SaxonApiException { PipelineConfiguration pipe = processor.getUnderlyingConfiguration().makePipelineConfiguration(); Receiver r = getReceiver(pipe, getSerializationProperties()); r = new NamespaceReducer(r); return new StreamWriterToReceiver(r); }
/** * Get an XMLStreamWriter that can be used for writing application-generated XML * to be output via this serializer. * * @return a newly constructed XMLStreamWriter that pipes events into this Serializer * @throws SaxonApiException if any other failure occurs * @since 9.3 */ public StreamWriterToReceiver getXMLStreamWriter() throws SaxonApiException { PipelineConfiguration pipe = processor.getUnderlyingConfiguration().makePipelineConfiguration(); Receiver r = getReceiver(pipe, getSerializationProperties()); r = new NamespaceReducer(r); return new StreamWriterToReceiver(r); }
private Receiver getDestinationReceiver(Destination destination) throws SaxonApiException { Executable exec = expression.getExecutable(); PipelineConfiguration pipe = expression.getConfiguration().makePipelineConfiguration(); Receiver out = destination.getReceiver(pipe, exec.getPrimarySerializationProperties()); if (Configuration.isAssertionsEnabled()) { return new RegularSequenceChecker(out); } else { return out; } }
private Receiver getDestinationReceiver(Destination destination) throws SaxonApiException { Executable exec = expression.getExecutable(); PipelineConfiguration pipe = expression.getConfiguration().makePipelineConfiguration(); Receiver out = destination.getReceiver(pipe, exec.getPrimarySerializationProperties()); if (Configuration.isAssertionsEnabled()) { return new RegularSequenceChecker(out); } else { return out; } }