/** * 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 */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = pipe; Configuration config = pipe.getConfiguration(); ignoreIgnorable = pipe.getParseOptions().getSpaceStrippingRule() != NoElementsSpaceStrippingRule.getInstance(); retainDTDAttributeTypes = config.getBooleanProperty(Feature.RETAIN_DTD_ATTRIBUTE_TYPES); if (!pipe.getParseOptions().isExpandAttributeDefaults()) { defaultedAttributesAction = -1; } else if (config.getBooleanProperty(Feature.MARK_DEFAULTED_ATTRIBUTES)) { defaultedAttributesAction = +1; } allowDisableOutputEscaping = config.getConfigurationProperty(Feature.USE_PI_DISABLE_OUTPUT_ESCAPING); lineNumbering = pipe.getParseOptions().isLineNumbering(); }
/** * 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 */ public void setPipelineConfiguration(PipelineConfiguration pipe) { this.pipe = pipe; Configuration config = pipe.getConfiguration(); ignoreIgnorable = pipe.getParseOptions().getSpaceStrippingRule() != NoElementsSpaceStrippingRule.getInstance(); retainDTDAttributeTypes = config.getBooleanProperty(Feature.RETAIN_DTD_ATTRIBUTE_TYPES); if (!pipe.getParseOptions().isExpandAttributeDefaults()) { defaultedAttributesAction = -1; } else if (config.getBooleanProperty(Feature.MARK_DEFAULTED_ATTRIBUTES)) { defaultedAttributesAction = +1; } allowDisableOutputEscaping = config.getConfigurationProperty(Feature.USE_PI_DISABLE_OUTPUT_ESCAPING); lineNumbering = pipe.getParseOptions().isLineNumbering(); }
/** * 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.</p> * * @return a newly constructed PipelineConfiguration holding a reference to this * Controller as well as other configuration information. */ /*@NotNull*/ public PipelineConfiguration makePipelineConfiguration() { PipelineConfiguration pipe = config.makePipelineConfiguration(); pipe.setURIResolver(userURIResolver == null ? standardURIResolver : userURIResolver); pipe.getParseOptions().setSchemaValidationMode(validationMode); // added in 9.7 pipe.getParseOptions().setErrorListener(errorListener); // added in 9.7.0.4 pipe.setController(this); final Executable executable = getExecutable(); if (executable != null) { // can be null for an IdentityTransformer 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.</p> * * @return a newly constructed PipelineConfiguration holding a reference to this * Controller as well as other configuration information. */ /*@NotNull*/ public PipelineConfiguration makePipelineConfiguration() { PipelineConfiguration pipe = config.makePipelineConfiguration(); pipe.setURIResolver(userURIResolver == null ? standardURIResolver : userURIResolver); pipe.getParseOptions().setSchemaValidationMode(validationMode); // added in 9.7 pipe.getParseOptions().setErrorListener(errorListener); // added in 9.7.0.4 pipe.setController(this); final Executable executable = getExecutable(); if (executable != null) { // can be null for an IdentityTransformer pipe.setHostLanguage(executable.getHostLanguage()); } return pipe; }
TreeModel model = treeModel; if (model == null) { int m = pipe.getParseOptions().getTreeModel(); if (m != Builder.UNSPECIFIED_TREE_MODEL) { model = TreeModel.getTreeModel(m);
TreeModel model = treeModel; if (model == null) { int m = pipe.getParseOptions().getTreeModel(); if (m != Builder.UNSPECIFIED_TREE_MODEL) { model = TreeModel.getTreeModel(m);
controller == null ? new StandardErrorListener() : controller.getErrorListener(); AbstractResourceCollection.setupErrorHandlingForCollection( newPipe.getParseOptions(), onError, oldErrorListener);
String escaped = file.toURI().toASCIIString(); Source source = new StreamSource(escaped); ParseOptions options = new ParseOptions(pipe.getParseOptions()); // bug 2273 if (validation != Validation.STRIP && validation != Validation.PRESERVE) { options.setSchemaValidationMode(validation);
String escaped = file.toURI().toASCIIString(); Source source = new StreamSource(escaped); ParseOptions options = new ParseOptions(pipe.getParseOptions()); // bug 2273 if (validation != Validation.STRIP && validation != Validation.PRESERVE) { options.setSchemaValidationMode(validation);
/** * Perform identify transformation from Source to Result */ public void transform(Source source, Result result) throws TransformerException { try { SerializerFactory sf = getConfiguration().getSerializerFactory(); Receiver receiver = sf.getReceiver(result, new SerializationProperties(getOutputProperties())); ParseOptions options = receiver.getPipelineConfiguration().getParseOptions(); options.setContinueAfterValidationErrors(true); Sender.send(source, receiver, options); } catch (XPathException err) { Throwable cause = err.getException(); if (cause instanceof SAXParseException) { // This generally means the error was already reported. // But if a RuntimeException occurs in Saxon during a callback from // the Crimson parser, Crimson wraps this in a SAXParseException without // reporting it further. SAXParseException spe = (SAXParseException) cause; cause = spe.getException(); if (cause instanceof RuntimeException) { reportFatalError(err); } } else { reportFatalError(err); } throw err; } }
/** * Perform identify transformation from Source to Result */ public void transform(Source source, Result result) throws TransformerException { try { SerializerFactory sf = getConfiguration().getSerializerFactory(); Receiver receiver = sf.getReceiver(result, new SerializationProperties(getOutputProperties())); ParseOptions options = receiver.getPipelineConfiguration().getParseOptions(); options.setContinueAfterValidationErrors(true); Sender.send(source, receiver, options); } catch (XPathException err) { Throwable cause = err.getException(); if (cause instanceof SAXParseException) { // This generally means the error was already reported. // But if a RuntimeException occurs in Saxon during a callback from // the Crimson parser, Crimson wraps this in a SAXParseException without // reporting it further. SAXParseException spe = (SAXParseException) cause; cause = spe.getException(); if (cause instanceof RuntimeException) { reportFatalError(err); } } else { reportFatalError(err); } throw err; } }
PipelineConfiguration pipe = receiver.getPipelineConfiguration(); if (options == null) { options = new ParseOptions(pipe.getParseOptions()); } else { options = new ParseOptions(options);
PipelineConfiguration pipe = receiver.getPipelineConfiguration(); if (options == null) { options = new ParseOptions(pipe.getParseOptions()); } else { options = new ParseOptions(options);
ParseOptions options = pipe.getParseOptions(); options.setCheckEntityReferences(true); setPipelineConfiguration(pipe);
ParseOptions options = pipe.getParseOptions(); options.setCheckEntityReferences(true); setPipelineConfiguration(pipe);
pipe.getParseOptions().setSchemaValidationMode(validationMode); r.setPipelineConfiguration(pipe); Sender.send(source, r, null);
pipe.getParseOptions().setSchemaValidationMode(validationMode); r.setPipelineConfiguration(pipe); Sender.send(source, r, null);
options = new ParseOptions(b.getPipelineConfiguration().getParseOptions()); if (packageData instanceof StylesheetPackage) { SpaceStrippingRule rule = ((StylesheetPackage)packageData).getSpaceStrippingRule();
pipe.getParseOptions().setSchemaValidationMode(this.validationMode); boolean verbose = getConfiguration().isTiming(); if (verbose) {
pipe.getParseOptions().setSchemaValidationMode(this.validationMode); boolean verbose = getConfiguration().isTiming(); if (verbose) {