/** * Set the configuration. This can also be done using the JAXP method * setAttribute, with the attribute name {@link net.sf.saxon.lib.FeatureKeys#CONFIGURATION} * * @param config the Saxon configuration */ public void setConfiguration(Configuration config) { processor.setConfigurationProperty(Feature.CONFIGURATION, config); }
/** * Set the configuration. This can also be done using the JAXP method * setAttribute, with the attribute name {@link net.sf.saxon.lib.FeatureKeys#CONFIGURATION} * * @param config the Saxon configuration */ public void setConfiguration(Configuration config) { processor.setConfigurationProperty(Feature.CONFIGURATION, config); }
private void saxonConfigurationProperty(XdmNode node) { String value = node.getAttributeValue(_value); String key = node.getAttributeValue(_key); String type = node.getAttributeValue(_type); Object valueObj = null; if (key == null || value == null) { throw new XProcException("Configuration option 'saxon-configuration-property' cannot have a null key or value"); } if ("boolean".equals(type)) { valueObj = "true".equals(value); } else if ("integer".equals(type)) { valueObj = Integer.parseInt(value); } else { valueObj = value; } try { setSaxonProperties.add(key); cfgProcessor.setConfigurationProperty(key, valueObj); } catch (Exception e) { throw new XProcException(e); } }
private void saxonConfigurationProperty(XdmNode node) { String value = node.getAttributeValue(_value); String key = node.getAttributeValue(_key); String type = node.getAttributeValue(_type); Object valueObj = null; if (key == null || value == null) { throw new XProcException("Configuration option 'saxon-configuration-property' cannot have a null key or value"); } if ("boolean".equals(type)) { valueObj = "true".equals(value); } else if ("integer".equals(type)) { valueObj = Integer.parseInt(value); } else { valueObj = value; } try { setSaxonProperties.add(key); cfgProcessor.setConfigurationProperty(key, valueObj); } catch (Exception e) { throw new XProcException(e); } }
/** * Constructs a validator for the given Schematron schema and phase (pattern * set). * * @param schema * The Source that represents the schema. * @param phase * The active phase; if null, the default phase is enabled (all * patterns are active if no default is specified). * @throws Exception * If any error occurs while attempting to read or preprocess * the schema. */ public SchematronValidator(Source schema, String phase) throws Exception { if (schema == null) { throw new IllegalArgumentException("No schema Source provided."); } processor = new Processor(false); processor.setConfigurationProperty(FeatureKeys.RECOVERY_POLICY, Configuration.RECOVER_SILENTLY); XsltExecutable xslt = compileSchema(schema, phase); this.transformer = xslt.load(); }
processor.setConfigurationProperty(FeatureKeys.LINE_NUMBERING, Boolean.TRUE); XsltCompiler generatorCompiler = processor.newXsltCompiler();
processor.setConfigurationProperty(FeatureKeys.LINE_NUMBERING, Boolean.TRUE); XsltCompiler generatorCompiler = processor.newXsltCompiler();
public SaxonCommand(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); this.isTracing = getConfigs().getBoolean(config, "isTracing", false); boolean isLicensedSaxonEdition = getConfigs().getBoolean(config, "isLicensedSaxonEdition", false); this.processor = new Processor(isLicensedSaxonEdition); this.documentBuilder = processor.newDocumentBuilder(); Config features = getConfigs().getConfig(config, "features", ConfigFactory.empty()); for (Map.Entry<String, Object> entry : new Configs().getEntrySet(features)) { processor.setConfigurationProperty(entry.getKey(), entry.getValue()); } }
proc.setConfigurationProperty(entry.getKey(), entry.getValue());
proc.setConfigurationProperty(entry.getKey(), entry.getValue());
processor.setConfigurationProperty(entry.getKey(), entry.getValue());
proc.setConfigurationProperty(entry.getKey(), entry.getValue());
String value = configOptions.getProperty(name); try { processor.setConfigurationProperty("http://saxon.sf.net/feature/" + name, value); } catch (IllegalArgumentException err) { throw new XPathException(err.getMessage()); processor.setConfigurationProperty(Feature.COLLECTION_URI_RESOLVER, (CollectionURIResolver)resolver); if (value != null) { if ("strict".equals(value)) { processor.setConfigurationProperty(Feature.SCHEMA_VALIDATION, Validation.STRICT); } else if ("lax".equals(value)) { processor.setConfigurationProperty(Feature.SCHEMA_VALIDATION, Validation.LAX); if (value != null) { if ("silent".equals(value)) { processor.setConfigurationProperty(Feature.RECOVERY_POLICY, Configuration.RECOVER_SILENTLY); } else if ("recover".equals(value)) { processor.setConfigurationProperty(Feature.RECOVERY_POLICY, Configuration.RECOVER_WITH_WARNINGS); } else if ("fatal".equals(value)) { processor.setConfigurationProperty(Feature.RECOVERY_POLICY, Configuration.DO_NOT_RECOVER); processor.setConfigurationProperty(Feature.SOURCE_PARSER_CLASS, value); processor.setConfigurationProperty(Feature.XINCLUDE, "on".equals(value));
processor.setConfigurationProperty(Feature.COLLECTION_URI_RESOLVER, (CollectionURIResolver)resolver); if (value != null) { if ("strict".equals(value)) { processor.setConfigurationProperty(Feature.SCHEMA_VALIDATION, Validation.STRICT); } else if ("lax".equals(value)) { processor.setConfigurationProperty(Feature.SCHEMA_VALIDATION, Validation.LAX); if (value != null) { if ("silent".equals(value)) { processor.setConfigurationProperty(Feature.RECOVERY_POLICY, Configuration.RECOVER_SILENTLY); } else if ("recover".equals(value)) { processor.setConfigurationProperty(Feature.RECOVERY_POLICY, Configuration.RECOVER_WITH_WARNINGS); } else if ("fatal".equals(value)) { processor.setConfigurationProperty(Feature.RECOVERY_POLICY, Configuration.DO_NOT_RECOVER); processor.setConfigurationProperty(Feature.SOURCE_PARSER_CLASS, value); if (value != null) { boolean on = Configuration.requireBoolean("xi", value); processor.setConfigurationProperty(Feature.XINCLUDE, on); processor.setConfigurationProperty(Feature.XML_VERSION, value); processor.setConfigurationProperty(Feature.XSD_VERSION, value);
if (value != null) { explain = true; processor.setConfigurationProperty(Feature.TRACE_OPTIMIZER_DECISIONS, true); jit = false; compiler.setJustInTimeCompilation(jit); System.err.println(config.getProductTitle()); System.err.println(Version.platform.getPlatformVersion()); processor.setConfigurationProperty(Feature.TIMING, true); showTime = true; processor.setConfigurationProperty(Feature.TRACE_LISTENER, traceListener); processor.setConfigurationProperty(Feature.LINE_NUMBERING, true); if (value != null) { traceListener = new TimingTraceListener(); processor.setConfigurationProperty(Feature.TRACE_LISTENER, traceListener); processor.setConfigurationProperty(Feature.LINE_NUMBERING, true); compiler.getUnderlyingCompilerInfo().setCodeInjector(new TimingCodeInjector()); if (!value.isEmpty()) { if (value != null) { sourceParserName = value; processor.setConfigurationProperty(Feature.SOURCE_PARSER_CLASS, sourceParserName); processor.setConfigurationProperty(Feature.XSD_VERSION, value); if (value != null) { styleParserName = value;
for (MediatorProperty processorProperty : processorProperties) { if (processorProperty != null) { cachedProcessor.setConfigurationProperty(processorProperty.getName(), processorProperty.getValue());
if (b) { if (processor.getUnderlyingConfiguration().isLicensedFeature(Configuration.LicenseFeature.ENTERPRISE_XSLT)) { processor.setConfigurationProperty(Feature.XSLT_SCHEMA_AWARE, true); } else { unsuitable("is-schema-aware", value.getStringValue()); processor.setConfigurationProperty(Feature.STREAMABILITY, "off"); processor.setConfigurationProperty(Feature.DISABLE_XSL_EVALUATE, true);
processor.setConfigurationProperty(Feature.CONFIGURATION, targetConfig); boolean isXslt30Processor = true; checkTransformOptions(options, context, isXslt30Processor);
processor.setConfigurationProperty(Feature.CONFIGURATION, targetConfig); boolean isXslt30Processor = true; checkTransformOptions(options, context, isXslt30Processor);
if (b) { if (processor.getUnderlyingConfiguration().isLicensedFeature(Configuration.LicenseFeature.ENTERPRISE_XSLT)) { processor.setConfigurationProperty(Feature.XSLT_SCHEMA_AWARE, true); } else { unsuitable("is-schema-aware", value.getStringValue()); processor.setConfigurationProperty(Feature.STREAMABILITY, "off"); processor.setConfigurationProperty(Feature.DISABLE_XSL_EVALUATE, true);