public void setPipelineConfiguration(PipelineConfiguration pipe) { PipelineConfiguration pipe2 = new PipelineConfiguration(pipe); pipe2.setLocationProvider(this); super.setPipelineConfiguration(pipe2); }
public void setPipelineConfiguration(PipelineConfiguration pipe) { PipelineConfiguration pipe2 = new PipelineConfiguration(pipe); pipe2.setLocationProvider(this); super.setPipelineConfiguration(pipe2); }
/** * Set configuration information. This must only be called before any events * have been read. * @param pipe the pipeline configuration */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = new PipelineConfiguration(pipe); this.pipe.setLocationProvider(this); config = pipe.getConfiguration(); ignoreIgnorable = config.getStripsWhiteSpace() != Whitespace.NONE; }
/** * Receive notification of the beginning of a document. */ public void startDocument () throws SAXException { // System.err.println("ReceivingContentHandler#startDocument"); try { charsUsed = 0; namespacesUsed = 0; pipe.setLocationProvider(localLocator); receiver.setPipelineConfiguration(pipe); receiver.open(); receiver.startDocument(0); } catch (XPathException err) { throw new SAXException(err); } }
/** * Receive notification of the beginning of a document. */ public void startDocument () throws SAXException { // System.err.println("ReceivingContentHandler#startDocument"); try { charsUsed = 0; namespacesUsed = 0; pipe.setLocationProvider(localLocator); receiver.setPipelineConfiguration(pipe); receiver.open(); receiver.startDocument(0); } catch (XPathException err) { throw new SAXException(err); } }
/** * Receive notification of the beginning of a document. */ public void startDocument () throws SAXException { // System.err.println("ReceivingContentHandler#startDocument"); try { charsUsed = 0; namespacesUsed = 0; pipe.setLocationProvider(localLocator); receiver.setPipelineConfiguration(pipe); receiver.open(); receiver.startDocument(0); } catch (XPathException err) { throw new SAXException(err); } }
/** * Set configuration information. This must only be called before any events * have been read. */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = new PipelineConfiguration(pipe); this.pipe.setLocationProvider(this); ignoreIgnorable = pipe.getConfiguration().getStripsWhiteSpace() != Whitespace.NONE; }
/** * Set configuration information. This must only be called before any events * have been read. * @param pipe the pipeline configuration */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = new PipelineConfiguration(pipe); this.pipe.setLocationProvider(this); config = pipe.getConfiguration(); ignoreIgnorable = config.getStripsWhiteSpace() != Whitespace.NONE; }
/** * Set configuration information. This must only be called before any events * have been read. */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = new PipelineConfiguration(pipe); this.pipe.setLocationProvider(this); ignoreIgnorable = pipe.getConfiguration().getStripsWhiteSpace() != Whitespace.NONE; }
/** * Create a TinyTreeEventIterator to return events associated with a tree or subtree * @param startNode the root of the tree or subtree. Must be a document or element node. * @param pipe the Saxon pipeline configuration * @throws IllegalArgumentException if the start node is an attribute or namespace node. */ public TinyTreeEventIterator(TinyNodeImpl startNode, PipelineConfiguration pipe) { this.pipe = pipe; this.pipe.setLocationProvider(this); int kind = startNode.getNodeKind(); if (kind != Type.DOCUMENT && kind != Type.ELEMENT) { throw new IllegalArgumentException("TinyTreeEventIterator must start at a document or element node"); } startNodeNr = startNode.nodeNr; currentNodeNr = startNodeNr; tree = startNode.tree; pendingEndEvents = 0; startAtDocument = (kind == Type.DOCUMENT); NamespaceDeclarationsImpl nsDeclarations = new NamespaceDeclarationsImpl(); nsDeclarations.setNamePool(startNode.getNamePool()); }
/** * Set the pipeline configuration * @param pipe the pipeline configuration. This holds a reference to the Saxon configuration, as well as * information that can vary from one pipeline to another, for example the LocationProvider which resolves * the location of events in a source document */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = pipe; pipe.setLocationProvider(localLocator); Configuration config = pipe.getConfiguration(); pool = config.getNamePool(); ignoreIgnorable = config.getStripsWhiteSpace() != Whitespace.NONE; retainDTDAttributeTypes = config.isRetainDTDAttributeTypes(); suppressDTDAttributeDefaults = !pipe.isExpandAttributeDefaults(); Boolean b = (Boolean)config.getConfigurationProperty(FeatureKeys.USE_PI_DISABLE_OUTPUT_ESCAPING); allowDisableOutputEscaping = b.booleanValue(); }
/** * Set the pipeline configuration * @param pipe the pipeline configuration. This holds a reference to the Saxon configuration, as well as * information that can vary from one pipeline to another, for example the LocationProvider which resolves * the location of events in a source document */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = pipe; pipe.setLocationProvider(localLocator); Configuration config = pipe.getConfiguration(); pool = config.getNamePool(); ignoreIgnorable = config.getStripsWhiteSpace() != Whitespace.NONE; retainDTDAttributeTypes = config.isRetainDTDAttributeTypes(); suppressDTDAttributeDefaults = !pipe.isExpandAttributeDefaults(); Boolean b = (Boolean)config.getConfigurationProperty(FeatureKeys.USE_PI_DISABLE_OUTPUT_ESCAPING); allowDisableOutputEscaping = b.booleanValue(); }
/** * Set the pipeline configuration * @param pipe the pipeline configuration. This holds a reference to the Saxon configuration, as well as * information that can vary from one pipeline to another, for example the LocationProvider which resolves * the location of events in a source document */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = pipe; pipe.setLocationProvider(localLocator); Configuration config = pipe.getConfiguration(); pool = config.getNamePool(); ignoreIgnorable = config.getStripsWhiteSpace() != Whitespace.NONE; retainDTDAttributeTypes = config.isRetainDTDAttributeTypes(); suppressDTDAttributeDefaults = !pipe.isExpandAttributeDefaults(); Boolean b = (Boolean)config.getConfigurationProperty(FeatureKeys.USE_PI_DISABLE_OUTPUT_ESCAPING); allowDisableOutputEscaping = b.booleanValue(); }
private void sendPullSource(PullSource source, Receiver receiver, int validation, int stripSpace) throws XPathException { // if (validation != Validation.PRESERVE && validation != Validation.STRIP) { // throw new XPathException("Validation is not currently supported with a PullSource"); // } if ((validation & Validation.VALIDATION_MODE_MASK) != Validation.PRESERVE) { // Add a document validator to the pipeline final Configuration config = pipe.getConfiguration(); receiver = config.getDocumentValidator(receiver, source.getSystemId(), validation, stripSpace, null, -1); } //receiver.open(); PullProvider provider = source.getPullProvider(); if (provider instanceof LocationProvider) { pipe.setLocationProvider((LocationProvider)provider); } provider.setPipelineConfiguration(pipe); receiver.setPipelineConfiguration(pipe); PullPushCopier copier = new PullPushCopier(provider, receiver); copier.copy(); //receiver.close(); }
/** * Send the entire document to the receiver */ public void send(Receiver receiver) throws XPathException { PipelineConfiguration pipe = receiver.getPipelineConfiguration(); if (top.getNamePool() != pipe.getConfiguration().getNamePool() && !(receiver instanceof NamePoolConverter)) { throw new IllegalArgumentException("DocumentSender source and target must use the same NamePool"); } // set system id if (pipe.getLocationProvider() == null) { receiver.setSystemId(top.getSystemId()); pipe.setLocationProvider(this); } // start event stream receiver.open(); // copy the contents of the document receiver.startDocument(0); top.copy(receiver, NodeInfo.ALL_NAMESPACES, true, 0); receiver.endDocument(); // end event stream receiver.close(); }
/** * Send the entire document to the receiver */ public void send(Receiver receiver) throws XPathException { PipelineConfiguration pipe = receiver.getPipelineConfiguration(); if (top.getNamePool() != pipe.getConfiguration().getNamePool() && !(receiver instanceof NamePoolConverter)) { throw new IllegalArgumentException("DocumentSender source and target must use the same NamePool"); } // set system id if (pipe.getLocationProvider() == null) { receiver.setSystemId(top.getSystemId()); pipe.setLocationProvider(this); } // start event stream receiver.open(); // copy the contents of the document receiver.startDocument(0); top.copy(receiver, NodeInfo.ALL_NAMESPACES, true, 0); receiver.endDocument(); // end event stream receiver.close(); }
private void sendPullEventSource(PullEventSource source, Receiver receiver, ParseOptions options) throws XPathException { boolean xInclude = options.isXIncludeAware(); if (xInclude) { throw new XPathException("XInclude processing is not supported with a pull parser"); } receiver = makeValidator(receiver, source.getSystemId(), options); receiver.open(); EventIterator provider = source.getEventIterator(); if (provider instanceof LocationProvider) { pipe.setLocationProvider((LocationProvider)provider); } receiver.setPipelineConfiguration(pipe); SequenceReceiver out = receiver instanceof SequenceReceiver ? ((SequenceReceiver)receiver) : new TreeReceiver(receiver); EventIteratorToReceiver.copy(provider, out); receiver.close(); }
private void sendPullSource(PullSource source, Receiver receiver, ParseOptions options) throws XPathException { boolean xInclude = options.isXIncludeAware(); if (xInclude) { throw new XPathException("XInclude processing is not supported with a pull parser"); } receiver = makeValidator(receiver, source.getSystemId(), options); PullProvider provider = source.getPullProvider(); if (provider instanceof LocationProvider) { pipe.setLocationProvider((LocationProvider)provider); } provider.setPipelineConfiguration(pipe); receiver.setPipelineConfiguration(pipe); PullPushCopier copier = new PullPushCopier(provider, receiver); try { copier.copy(); } finally { if (options.isPleaseCloseAfterUse()) { provider.close(); } } }
/** * Make a PipelineConfiguration based on the properties of this Controller. * <p> * This interface is intended primarily for internal use, although it may be necessary * for applications to call it directly if they construct pull or push pipelines * @return a newly constructed PipelineConfiguration holding a reference to this * Controller as well as other configuration information. */ public PipelineConfiguration makePipelineConfiguration() { PipelineConfiguration pipe = new PipelineConfiguration(); pipe.setConfiguration(getConfiguration()); pipe.setErrorListener(getErrorListener()); pipe.setURIResolver(userURIResolver==null ? standardURIResolver : userURIResolver); pipe.setSchemaURIResolver(schemaURIResolver); pipe.setExpandAttributeDefaults(getConfiguration().isExpandAttributeDefaults()); pipe.setUseXsiSchemaLocation(((Boolean)getConfiguration().getConfigurationProperty( FeatureKeys.USE_XSI_SCHEMA_LOCATION)).booleanValue()); pipe.setController(this); final Executable executable = getExecutable(); if (executable != null) { // can be null for an IdentityTransformer pipe.setLocationProvider(executable.getLocationMap()); pipe.setHostLanguage(executable.getHostLanguage()); } return pipe; }
/** * Make a PipelineConfiguration based on the properties of this Controller. * <p> * This interface is intended primarily for internal use, although it may be necessary * for applications to call it directly if they construct pull or push pipelines * @return a newly constructed PipelineConfiguration holding a reference to this * Controller as well as other configuration information. */ public PipelineConfiguration makePipelineConfiguration() { PipelineConfiguration pipe = new PipelineConfiguration(); pipe.setConfiguration(getConfiguration()); pipe.setErrorListener(getErrorListener()); pipe.setURIResolver(userURIResolver==null ? standardURIResolver : userURIResolver); pipe.setSchemaURIResolver(schemaURIResolver); pipe.setExpandAttributeDefaults(getConfiguration().isExpandAttributeDefaults()); pipe.setController(this); final Executable executable = getExecutable(); if (executable != null) { // can be null for an IdentityTransformer pipe.setLocationProvider(executable.getLocationMap()); pipe.setHostLanguage(executable.getHostLanguage()); } return pipe; }