This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new ebaf2a079b3e CAMEL-26976: camel-xslt - apply
transformerFactoryConfigurationStrategy and secureProcessing in all
configurations (#30007)
ebaf2a079b3e is described below
commit ebaf2a079b3e467c9545bfac0eaf3a8a400e3ded
Author: Federico Mariani <[email protected]>
AuthorDate: Sun Nov 15 19:03:17 2026 +0100
CAMEL-26976: camel-xslt - apply transformerFactoryConfigurationStrategy and
secureProcessing in all configurations (#30007)
Co-authored-by: Claude <[email protected]>
---
.../org/apache/camel/catalog/components/xj.json | 8 +-
.../camel/catalog/components/xslt-saxon.json | 8 +-
.../META-INF/org/apache/camel/component/xj/xj.json | 8 +-
.../camel/component/xslt/saxon/xslt-saxon.json | 8 +-
.../component/xslt/saxon/XsltSaxonComponent.java | 7 +-
.../component/xslt/saxon/XsltSaxonEndpoint.java | 21 +++--
.../XsltSaxonComponentFactoryOptionsTest.java | 85 +++++++++++++++++
...XsltSaxonConfigurationSecureProcessingTest.java | 101 +++++++++++++++++++++
.../camel/component/xslt/saxon/result-document.xsl | 31 +++++++
.../apache/camel/component/xslt/XsltEndpoint.java | 14 +--
...ransformerFactoryConfigurationStrategyTest.java | 101 +++++++++++++++++++++
.../ROOT/pages/camel-4x-upgrade-guide-4_22.adoc | 16 ++++
.../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc | 16 ++++
.../component/dsl/XjComponentBuilderFactory.java | 10 +-
.../dsl/XsltSaxonComponentBuilderFactory.java | 10 +-
.../endpoint/dsl/XJEndpointBuilderFactory.java | 18 +++-
.../dsl/XsltSaxonEndpointBuilderFactory.java | 18 +++-
17 files changed, 438 insertions(+), 42 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xj.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xj.json
index 9c88ddd8fd9f..b3eb833608e0 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xj.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xj.json
@@ -28,7 +28,7 @@
"contentCache": { "index": 1, "kind": "property", "displayName": "Content
Cache", "group": "producer", "label": "", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": true, "description": "Cache for the resource content
(the stylesheet file) when it is loaded. If set to false Camel will reload the
stylesheet file on each message processing. This is good for development. A
cached stylesheet can be forc [...]
"lazyStartProducer": { "index": 2, "kind": "property", "displayName":
"Lazy Start Producer", "group": "producer", "label": "producer", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": false, "description":
"Whether the producer should be started lazy (on the first message). By
starting lazy you can use this to allow CamelContext and routes to startup in
situations where a producer may otherwise fail [...]
"autowiredEnabled": { "index": 3, "kind": "property", "displayName":
"Autowired Enabled", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": true, "description":
"Whether autowiring is enabled. This is used for automatic autowiring options
(the option must be marked as autowired) by looking up in the registry to find
if there is a single instance of matching t [...]
- "saxonConfiguration": { "index": 4, "kind": "property", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration" },
+ "saxonConfiguration": { "index": 4, "kind": "property", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration. It is shared by all the endpoints of this
component that do not set their own. The secureProcessing option is applied to
this configuration, which Saxon uses by r [...]
"saxonConfigurationProperties": { "index": 5, "kind": "property",
"displayName": "Saxon Configuration Properties", "group": "advanced", "label":
"advanced", "required": false, "type": "object", "javaType":
"java.util.Map<java.lang.String, java.lang.Object>", "deprecated": false,
"autowired": false, "secret": false, "description": "To set custom Saxon
configuration properties" },
"saxonExtensionFunctions": { "index": 6, "kind": "property",
"displayName": "Saxon Extension Functions", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "Allows you to use a custom
net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add camel-saxon
to the classpath. The function is looked up in the registry, where you can use
commas to se [...]
"transformerFactoryClass": { "index": 7, "kind": "property",
"displayName": "Transformer Factory Class", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "To use a custom XSLT transformer factory, specified as a FQN
class name" },
@@ -36,7 +36,7 @@
"uriResolver": { "index": 9, "kind": "property", "displayName": "Uri
Resolver", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "javax.xml.transform.URIResolver", "deprecated": false,
"autowired": false, "secret": false, "description": "To use a custom
UriResolver. Should not be used together with the option 'uriResolverFactory'."
},
"uriResolverFactory": { "index": 10, "kind": "property", "displayName":
"Uri Resolver Factory", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType":
"org.apache.camel.component.xslt.XsltUriResolverFactory", "deprecated": false,
"autowired": false, "secret": false, "description": "To use a custom
UriResolver which depends on a dynamic endpoint resource URI. Should not be
used together with the option 'uriResolver'." },
"xpathTotalOpLimit": { "index": 11, "kind": "property", "displayName":
"Xpath Total Op Limit", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 10000, "description": "Limits the total
number of XPath operators in an XSL Stylesheet. The default (from JDK) is
10000. The limit is set per TransformerFactory instance used by each endpoint,
not as a JVM-global system [...]
- "secureProcessing": { "index": 12, "kind": "property", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
+ "secureProcessing": { "index": 12, "kind": "property", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
},
"headers": {
"CamelXsltFileName": { "index": 0, "kind": "header", "displayName": "",
"group": "producer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
XSLT file name", "constantName":
"org.apache.camel.component.xj.XJConstants#XSLT_FILE_NAME" },
@@ -63,7 +63,7 @@
"entityResolver": { "index": 12, "kind": "parameter", "displayName":
"Entity Resolver", "group": "advanced", "label": "advanced", "required": false,
"type": "object", "javaType": "org.xml.sax.EntityResolver", "deprecated":
false, "autowired": false, "secret": false, "description": "To use a custom
org.xml.sax.EntityResolver with javax.xml.transform.sax.SAXSource." },
"errorListener": { "index": 13, "kind": "parameter", "displayName": "Error
Listener", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "javax.xml.transform.ErrorListener", "deprecated": false,
"autowired": false, "secret": false, "description": "Allows to configure to use
a custom javax.xml.transform.ErrorListener. Beware when doing this then the
default error listener which captures any errors or fatal errors and store
information on the Exc [...]
"resultHandlerFactory": { "index": 14, "kind": "parameter", "displayName":
"Result Handler Factory", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType":
"org.apache.camel.component.xslt.ResultHandlerFactory", "deprecated": false,
"autowired": false, "secret": false, "description": "Allows you to use a custom
org.apache.camel.builder.xml.ResultHandlerFactory which is capable of using
custom org.apache.camel.builder.xml.ResultHandler types." },
- "saxonConfiguration": { "index": 15, "kind": "parameter", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration" },
+ "saxonConfiguration": { "index": 15, "kind": "parameter", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration. The secureProcessing option is applied to
this configuration, which Saxon uses by reference, so endpoints that share the
same configuration must use the same se [...]
"saxonExtensionFunctions": { "index": 16, "kind": "parameter",
"displayName": "Saxon Extension Functions", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "Allows you to use a custom
net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add camel-saxon
to the classpath. The function is looked up in the registry, where you can
comma to separ [...]
"transformerFactory": { "index": 17, "kind": "parameter", "displayName":
"Transformer Factory", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "javax.xml.transform.TransformerFactory",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom XSLT transformer factory" },
"transformerFactoryClass": { "index": 18, "kind": "parameter",
"displayName": "Transformer Factory Class", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "To use a custom XSLT transformer factory, specified as a FQN
class name" },
@@ -71,6 +71,6 @@
"uriResolver": { "index": 20, "kind": "parameter", "displayName": "Uri
Resolver", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "javax.xml.transform.URIResolver", "deprecated": false,
"autowired": false, "secret": false, "description": "To use a custom
javax.xml.transform.URIResolver" },
"xpathTotalOpLimit": { "index": 21, "kind": "parameter", "displayName":
"Xpath Total Op Limit", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 10000, "description": "Limits the total
number of XPath operators in an XSL Stylesheet. The default (from JDK) is
10000. The limit is set per TransformerFactory instance used by this endpoint."
},
"xsltMessageLogger": { "index": 22, "kind": "parameter", "displayName":
"Xslt Message Logger", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType":
"org.apache.camel.component.xslt.XsltMessageLogger", "deprecated": false,
"autowired": false, "secret": false, "description": "A consumer to messages
generated during XSLT transformations." },
- "secureProcessing": { "index": 23, "kind": "parameter", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
+ "secureProcessing": { "index": 23, "kind": "parameter", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
}
}
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xslt-saxon.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xslt-saxon.json
index f2c5c5c11972..cbe55356d2e8 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xslt-saxon.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/xslt-saxon.json
@@ -28,7 +28,7 @@
"contentCache": { "index": 1, "kind": "property", "displayName": "Content
Cache", "group": "producer", "label": "", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": true, "description": "Cache for the resource content
(the stylesheet file) when it is loaded. If set to false Camel will reload the
stylesheet file on each message processing. This is good for development. A
cached stylesheet can be forc [...]
"lazyStartProducer": { "index": 2, "kind": "property", "displayName":
"Lazy Start Producer", "group": "producer", "label": "producer", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": false, "description":
"Whether the producer should be started lazy (on the first message). By
starting lazy you can use this to allow CamelContext and routes to startup in
situations where a producer may otherwise fail [...]
"autowiredEnabled": { "index": 3, "kind": "property", "displayName":
"Autowired Enabled", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": true, "description":
"Whether autowiring is enabled. This is used for automatic autowiring options
(the option must be marked as autowired) by looking up in the registry to find
if there is a single instance of matching t [...]
- "saxonConfiguration": { "index": 4, "kind": "property", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration" },
+ "saxonConfiguration": { "index": 4, "kind": "property", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration. It is shared by all the endpoints of this
component that do not set their own. The secureProcessing option is applied to
this configuration, which Saxon uses by r [...]
"saxonConfigurationProperties": { "index": 5, "kind": "property",
"displayName": "Saxon Configuration Properties", "group": "advanced", "label":
"advanced", "required": false, "type": "object", "javaType":
"java.util.Map<java.lang.String, java.lang.Object>", "deprecated": false,
"autowired": false, "secret": false, "description": "To set custom Saxon
configuration properties" },
"saxonExtensionFunctions": { "index": 6, "kind": "property",
"displayName": "Saxon Extension Functions", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "Allows you to use a custom
net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add camel-saxon
to the classpath. The function is looked up in the registry, where you can use
commas to se [...]
"transformerFactoryClass": { "index": 7, "kind": "property",
"displayName": "Transformer Factory Class", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "To use a custom XSLT transformer factory, specified as a FQN
class name" },
@@ -36,7 +36,7 @@
"uriResolver": { "index": 9, "kind": "property", "displayName": "Uri
Resolver", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "javax.xml.transform.URIResolver", "deprecated": false,
"autowired": false, "secret": false, "description": "To use a custom
UriResolver. Should not be used together with the option 'uriResolverFactory'."
},
"uriResolverFactory": { "index": 10, "kind": "property", "displayName":
"Uri Resolver Factory", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType":
"org.apache.camel.component.xslt.XsltUriResolverFactory", "deprecated": false,
"autowired": false, "secret": false, "description": "To use a custom
UriResolver which depends on a dynamic endpoint resource URI. Should not be
used together with the option 'uriResolver'." },
"xpathTotalOpLimit": { "index": 11, "kind": "property", "displayName":
"Xpath Total Op Limit", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 10000, "description": "Limits the total
number of XPath operators in an XSL Stylesheet. The default (from JDK) is
10000. The limit is set per TransformerFactory instance used by each endpoint,
not as a JVM-global system [...]
- "secureProcessing": { "index": 12, "kind": "property", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
+ "secureProcessing": { "index": 12, "kind": "property", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
},
"headers": {
"CamelXsltResourceUri": { "index": 0, "kind": "header", "displayName": "",
"group": "producer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "A URI
for the template resource to load and use instead of the endpoint configured.",
"constantName":
"org.apache.camel.component.xslt.XsltConstants#XSLT_RESOURCE_URI" },
@@ -62,7 +62,7 @@
"entityResolver": { "index": 11, "kind": "parameter", "displayName":
"Entity Resolver", "group": "advanced", "label": "advanced", "required": false,
"type": "object", "javaType": "org.xml.sax.EntityResolver", "deprecated":
false, "autowired": false, "secret": false, "description": "To use a custom
org.xml.sax.EntityResolver with javax.xml.transform.sax.SAXSource." },
"errorListener": { "index": 12, "kind": "parameter", "displayName": "Error
Listener", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "javax.xml.transform.ErrorListener", "deprecated": false,
"autowired": false, "secret": false, "description": "Allows to configure to use
a custom javax.xml.transform.ErrorListener. Beware when doing this then the
default error listener which captures any errors or fatal errors and store
information on the Exc [...]
"resultHandlerFactory": { "index": 13, "kind": "parameter", "displayName":
"Result Handler Factory", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType":
"org.apache.camel.component.xslt.ResultHandlerFactory", "deprecated": false,
"autowired": false, "secret": false, "description": "Allows you to use a custom
org.apache.camel.builder.xml.ResultHandlerFactory which is capable of using
custom org.apache.camel.builder.xml.ResultHandler types." },
- "saxonConfiguration": { "index": 14, "kind": "parameter", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration" },
+ "saxonConfiguration": { "index": 14, "kind": "parameter", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration. The secureProcessing option is applied to
this configuration, which Saxon uses by reference, so endpoints that share the
same configuration must use the same se [...]
"saxonExtensionFunctions": { "index": 15, "kind": "parameter",
"displayName": "Saxon Extension Functions", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "Allows you to use a custom
net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add camel-saxon
to the classpath. The function is looked up in the registry, where you can
comma to separ [...]
"transformerFactory": { "index": 16, "kind": "parameter", "displayName":
"Transformer Factory", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "javax.xml.transform.TransformerFactory",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom XSLT transformer factory" },
"transformerFactoryClass": { "index": 17, "kind": "parameter",
"displayName": "Transformer Factory Class", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "To use a custom XSLT transformer factory, specified as a FQN
class name" },
@@ -70,6 +70,6 @@
"uriResolver": { "index": 19, "kind": "parameter", "displayName": "Uri
Resolver", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "javax.xml.transform.URIResolver", "deprecated": false,
"autowired": false, "secret": false, "description": "To use a custom
javax.xml.transform.URIResolver" },
"xpathTotalOpLimit": { "index": 20, "kind": "parameter", "displayName":
"Xpath Total Op Limit", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 10000, "description": "Limits the total
number of XPath operators in an XSL Stylesheet. The default (from JDK) is
10000. The limit is set per TransformerFactory instance used by this endpoint."
},
"xsltMessageLogger": { "index": 21, "kind": "parameter", "displayName":
"Xslt Message Logger", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType":
"org.apache.camel.component.xslt.XsltMessageLogger", "deprecated": false,
"autowired": false, "secret": false, "description": "A consumer to messages
generated during XSLT transformations." },
- "secureProcessing": { "index": 22, "kind": "parameter", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
+ "secureProcessing": { "index": 22, "kind": "parameter", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
}
}
diff --git
a/components/camel-xj/src/generated/resources/META-INF/org/apache/camel/component/xj/xj.json
b/components/camel-xj/src/generated/resources/META-INF/org/apache/camel/component/xj/xj.json
index 9c88ddd8fd9f..b3eb833608e0 100644
---
a/components/camel-xj/src/generated/resources/META-INF/org/apache/camel/component/xj/xj.json
+++
b/components/camel-xj/src/generated/resources/META-INF/org/apache/camel/component/xj/xj.json
@@ -28,7 +28,7 @@
"contentCache": { "index": 1, "kind": "property", "displayName": "Content
Cache", "group": "producer", "label": "", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": true, "description": "Cache for the resource content
(the stylesheet file) when it is loaded. If set to false Camel will reload the
stylesheet file on each message processing. This is good for development. A
cached stylesheet can be forc [...]
"lazyStartProducer": { "index": 2, "kind": "property", "displayName":
"Lazy Start Producer", "group": "producer", "label": "producer", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": false, "description":
"Whether the producer should be started lazy (on the first message). By
starting lazy you can use this to allow CamelContext and routes to startup in
situations where a producer may otherwise fail [...]
"autowiredEnabled": { "index": 3, "kind": "property", "displayName":
"Autowired Enabled", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": true, "description":
"Whether autowiring is enabled. This is used for automatic autowiring options
(the option must be marked as autowired) by looking up in the registry to find
if there is a single instance of matching t [...]
- "saxonConfiguration": { "index": 4, "kind": "property", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration" },
+ "saxonConfiguration": { "index": 4, "kind": "property", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration. It is shared by all the endpoints of this
component that do not set their own. The secureProcessing option is applied to
this configuration, which Saxon uses by r [...]
"saxonConfigurationProperties": { "index": 5, "kind": "property",
"displayName": "Saxon Configuration Properties", "group": "advanced", "label":
"advanced", "required": false, "type": "object", "javaType":
"java.util.Map<java.lang.String, java.lang.Object>", "deprecated": false,
"autowired": false, "secret": false, "description": "To set custom Saxon
configuration properties" },
"saxonExtensionFunctions": { "index": 6, "kind": "property",
"displayName": "Saxon Extension Functions", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "Allows you to use a custom
net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add camel-saxon
to the classpath. The function is looked up in the registry, where you can use
commas to se [...]
"transformerFactoryClass": { "index": 7, "kind": "property",
"displayName": "Transformer Factory Class", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "To use a custom XSLT transformer factory, specified as a FQN
class name" },
@@ -36,7 +36,7 @@
"uriResolver": { "index": 9, "kind": "property", "displayName": "Uri
Resolver", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "javax.xml.transform.URIResolver", "deprecated": false,
"autowired": false, "secret": false, "description": "To use a custom
UriResolver. Should not be used together with the option 'uriResolverFactory'."
},
"uriResolverFactory": { "index": 10, "kind": "property", "displayName":
"Uri Resolver Factory", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType":
"org.apache.camel.component.xslt.XsltUriResolverFactory", "deprecated": false,
"autowired": false, "secret": false, "description": "To use a custom
UriResolver which depends on a dynamic endpoint resource URI. Should not be
used together with the option 'uriResolver'." },
"xpathTotalOpLimit": { "index": 11, "kind": "property", "displayName":
"Xpath Total Op Limit", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 10000, "description": "Limits the total
number of XPath operators in an XSL Stylesheet. The default (from JDK) is
10000. The limit is set per TransformerFactory instance used by each endpoint,
not as a JVM-global system [...]
- "secureProcessing": { "index": 12, "kind": "property", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
+ "secureProcessing": { "index": 12, "kind": "property", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
},
"headers": {
"CamelXsltFileName": { "index": 0, "kind": "header", "displayName": "",
"group": "producer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "The
XSLT file name", "constantName":
"org.apache.camel.component.xj.XJConstants#XSLT_FILE_NAME" },
@@ -63,7 +63,7 @@
"entityResolver": { "index": 12, "kind": "parameter", "displayName":
"Entity Resolver", "group": "advanced", "label": "advanced", "required": false,
"type": "object", "javaType": "org.xml.sax.EntityResolver", "deprecated":
false, "autowired": false, "secret": false, "description": "To use a custom
org.xml.sax.EntityResolver with javax.xml.transform.sax.SAXSource." },
"errorListener": { "index": 13, "kind": "parameter", "displayName": "Error
Listener", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "javax.xml.transform.ErrorListener", "deprecated": false,
"autowired": false, "secret": false, "description": "Allows to configure to use
a custom javax.xml.transform.ErrorListener. Beware when doing this then the
default error listener which captures any errors or fatal errors and store
information on the Exc [...]
"resultHandlerFactory": { "index": 14, "kind": "parameter", "displayName":
"Result Handler Factory", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType":
"org.apache.camel.component.xslt.ResultHandlerFactory", "deprecated": false,
"autowired": false, "secret": false, "description": "Allows you to use a custom
org.apache.camel.builder.xml.ResultHandlerFactory which is capable of using
custom org.apache.camel.builder.xml.ResultHandler types." },
- "saxonConfiguration": { "index": 15, "kind": "parameter", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration" },
+ "saxonConfiguration": { "index": 15, "kind": "parameter", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration. The secureProcessing option is applied to
this configuration, which Saxon uses by reference, so endpoints that share the
same configuration must use the same se [...]
"saxonExtensionFunctions": { "index": 16, "kind": "parameter",
"displayName": "Saxon Extension Functions", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "Allows you to use a custom
net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add camel-saxon
to the classpath. The function is looked up in the registry, where you can
comma to separ [...]
"transformerFactory": { "index": 17, "kind": "parameter", "displayName":
"Transformer Factory", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "javax.xml.transform.TransformerFactory",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom XSLT transformer factory" },
"transformerFactoryClass": { "index": 18, "kind": "parameter",
"displayName": "Transformer Factory Class", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "To use a custom XSLT transformer factory, specified as a FQN
class name" },
@@ -71,6 +71,6 @@
"uriResolver": { "index": 20, "kind": "parameter", "displayName": "Uri
Resolver", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "javax.xml.transform.URIResolver", "deprecated": false,
"autowired": false, "secret": false, "description": "To use a custom
javax.xml.transform.URIResolver" },
"xpathTotalOpLimit": { "index": 21, "kind": "parameter", "displayName":
"Xpath Total Op Limit", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 10000, "description": "Limits the total
number of XPath operators in an XSL Stylesheet. The default (from JDK) is
10000. The limit is set per TransformerFactory instance used by this endpoint."
},
"xsltMessageLogger": { "index": 22, "kind": "parameter", "displayName":
"Xslt Message Logger", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType":
"org.apache.camel.component.xslt.XsltMessageLogger", "deprecated": false,
"autowired": false, "secret": false, "description": "A consumer to messages
generated during XSLT transformations." },
- "secureProcessing": { "index": 23, "kind": "parameter", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
+ "secureProcessing": { "index": 23, "kind": "parameter", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
}
}
diff --git
a/components/camel-xslt-saxon/src/generated/resources/META-INF/org/apache/camel/component/xslt/saxon/xslt-saxon.json
b/components/camel-xslt-saxon/src/generated/resources/META-INF/org/apache/camel/component/xslt/saxon/xslt-saxon.json
index f2c5c5c11972..cbe55356d2e8 100644
---
a/components/camel-xslt-saxon/src/generated/resources/META-INF/org/apache/camel/component/xslt/saxon/xslt-saxon.json
+++
b/components/camel-xslt-saxon/src/generated/resources/META-INF/org/apache/camel/component/xslt/saxon/xslt-saxon.json
@@ -28,7 +28,7 @@
"contentCache": { "index": 1, "kind": "property", "displayName": "Content
Cache", "group": "producer", "label": "", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": true, "description": "Cache for the resource content
(the stylesheet file) when it is loaded. If set to false Camel will reload the
stylesheet file on each message processing. This is good for development. A
cached stylesheet can be forc [...]
"lazyStartProducer": { "index": 2, "kind": "property", "displayName":
"Lazy Start Producer", "group": "producer", "label": "producer", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": false, "description":
"Whether the producer should be started lazy (on the first message). By
starting lazy you can use this to allow CamelContext and routes to startup in
situations where a producer may otherwise fail [...]
"autowiredEnabled": { "index": 3, "kind": "property", "displayName":
"Autowired Enabled", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": true, "description":
"Whether autowiring is enabled. This is used for automatic autowiring options
(the option must be marked as autowired) by looking up in the registry to find
if there is a single instance of matching t [...]
- "saxonConfiguration": { "index": 4, "kind": "property", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration" },
+ "saxonConfiguration": { "index": 4, "kind": "property", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration. It is shared by all the endpoints of this
component that do not set their own. The secureProcessing option is applied to
this configuration, which Saxon uses by r [...]
"saxonConfigurationProperties": { "index": 5, "kind": "property",
"displayName": "Saxon Configuration Properties", "group": "advanced", "label":
"advanced", "required": false, "type": "object", "javaType":
"java.util.Map<java.lang.String, java.lang.Object>", "deprecated": false,
"autowired": false, "secret": false, "description": "To set custom Saxon
configuration properties" },
"saxonExtensionFunctions": { "index": 6, "kind": "property",
"displayName": "Saxon Extension Functions", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "Allows you to use a custom
net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add camel-saxon
to the classpath. The function is looked up in the registry, where you can use
commas to se [...]
"transformerFactoryClass": { "index": 7, "kind": "property",
"displayName": "Transformer Factory Class", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "To use a custom XSLT transformer factory, specified as a FQN
class name" },
@@ -36,7 +36,7 @@
"uriResolver": { "index": 9, "kind": "property", "displayName": "Uri
Resolver", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "javax.xml.transform.URIResolver", "deprecated": false,
"autowired": false, "secret": false, "description": "To use a custom
UriResolver. Should not be used together with the option 'uriResolverFactory'."
},
"uriResolverFactory": { "index": 10, "kind": "property", "displayName":
"Uri Resolver Factory", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType":
"org.apache.camel.component.xslt.XsltUriResolverFactory", "deprecated": false,
"autowired": false, "secret": false, "description": "To use a custom
UriResolver which depends on a dynamic endpoint resource URI. Should not be
used together with the option 'uriResolver'." },
"xpathTotalOpLimit": { "index": 11, "kind": "property", "displayName":
"Xpath Total Op Limit", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 10000, "description": "Limits the total
number of XPath operators in an XSL Stylesheet. The default (from JDK) is
10000. The limit is set per TransformerFactory instance used by each endpoint,
not as a JVM-global system [...]
- "secureProcessing": { "index": 12, "kind": "property", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
+ "secureProcessing": { "index": 12, "kind": "property", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
},
"headers": {
"CamelXsltResourceUri": { "index": 0, "kind": "header", "displayName": "",
"group": "producer", "label": "", "required": false, "javaType": "String",
"deprecated": false, "autowired": false, "secret": false, "description": "A URI
for the template resource to load and use instead of the endpoint configured.",
"constantName":
"org.apache.camel.component.xslt.XsltConstants#XSLT_RESOURCE_URI" },
@@ -62,7 +62,7 @@
"entityResolver": { "index": 11, "kind": "parameter", "displayName":
"Entity Resolver", "group": "advanced", "label": "advanced", "required": false,
"type": "object", "javaType": "org.xml.sax.EntityResolver", "deprecated":
false, "autowired": false, "secret": false, "description": "To use a custom
org.xml.sax.EntityResolver with javax.xml.transform.sax.SAXSource." },
"errorListener": { "index": 12, "kind": "parameter", "displayName": "Error
Listener", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "javax.xml.transform.ErrorListener", "deprecated": false,
"autowired": false, "secret": false, "description": "Allows to configure to use
a custom javax.xml.transform.ErrorListener. Beware when doing this then the
default error listener which captures any errors or fatal errors and store
information on the Exc [...]
"resultHandlerFactory": { "index": 13, "kind": "parameter", "displayName":
"Result Handler Factory", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType":
"org.apache.camel.component.xslt.ResultHandlerFactory", "deprecated": false,
"autowired": false, "secret": false, "description": "Allows you to use a custom
org.apache.camel.builder.xml.ResultHandlerFactory which is capable of using
custom org.apache.camel.builder.xml.ResultHandler types." },
- "saxonConfiguration": { "index": 14, "kind": "parameter", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration" },
+ "saxonConfiguration": { "index": 14, "kind": "parameter", "displayName":
"Saxon Configuration", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "net.sf.saxon.Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom Saxon configuration. The secureProcessing option is applied to
this configuration, which Saxon uses by reference, so endpoints that share the
same configuration must use the same se [...]
"saxonExtensionFunctions": { "index": 15, "kind": "parameter",
"displayName": "Saxon Extension Functions", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "Allows you to use a custom
net.sf.saxon.lib.ExtensionFunctionDefinition. You would need to add camel-saxon
to the classpath. The function is looked up in the registry, where you can
comma to separ [...]
"transformerFactory": { "index": 16, "kind": "parameter", "displayName":
"Transformer Factory", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType": "javax.xml.transform.TransformerFactory",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom XSLT transformer factory" },
"transformerFactoryClass": { "index": 17, "kind": "parameter",
"displayName": "Transformer Factory Class", "group": "advanced", "label":
"advanced", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"description": "To use a custom XSLT transformer factory, specified as a FQN
class name" },
@@ -70,6 +70,6 @@
"uriResolver": { "index": 19, "kind": "parameter", "displayName": "Uri
Resolver", "group": "advanced", "label": "advanced", "required": false, "type":
"object", "javaType": "javax.xml.transform.URIResolver", "deprecated": false,
"autowired": false, "secret": false, "description": "To use a custom
javax.xml.transform.URIResolver" },
"xpathTotalOpLimit": { "index": 20, "kind": "parameter", "displayName":
"Xpath Total Op Limit", "group": "advanced", "label": "advanced", "required":
false, "type": "integer", "javaType": "int", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": 10000, "description": "Limits the total
number of XPath operators in an XSL Stylesheet. The default (from JDK) is
10000. The limit is set per TransformerFactory instance used by this endpoint."
},
"xsltMessageLogger": { "index": 21, "kind": "parameter", "displayName":
"Xslt Message Logger", "group": "advanced", "label": "advanced", "required":
false, "type": "object", "javaType":
"org.apache.camel.component.xslt.XsltMessageLogger", "deprecated": false,
"autowired": false, "secret": false, "description": "A consumer to messages
generated during XSLT transformations." },
- "secureProcessing": { "index": 22, "kind": "parameter", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
+ "secureProcessing": { "index": 22, "kind": "parameter", "displayName":
"Secure Processing", "group": "security", "label": "advanced,security",
"required": false, "type": "boolean", "javaType": "boolean", "deprecated":
false, "autowired": false, "secret": false, "security": "insecure:dev",
"insecureValue": "false", "defaultValue": true, "description": "Feature for XML
secure processing (see javax.xml.XMLConstants). This is enabled by default.
However, when using Saxon Professional you [...]
}
}
diff --git
a/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonComponent.java
b/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonComponent.java
index 7de498921d6e..6d44e063e02c 100644
---
a/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonComponent.java
+++
b/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonComponent.java
@@ -75,7 +75,8 @@ public class XsltSaxonComponent extends XsltComponent {
* Feature for XML secure processing (see javax.xml.XMLConstants). This is
enabled by default. However, when using
* Saxon Professional you may need to turn this off to allow Saxon to be
able to use Java extension functions. Note
* that turning it off also restores the previous, unrestricted parsing of
a {@code Source} message body that is
- * still to be parsed, so only do so for trusted input.
+ * still to be parsed, so only do so for trusted input. With a
saxonConfiguration, the feature is set on that
+ * configuration, so endpoints that share the same configuration must use
the same secureProcessing value.
*/
public void setSecureProcessing(boolean secureProcessing) {
this.secureProcessing = secureProcessing;
@@ -86,7 +87,9 @@ public class XsltSaxonComponent extends XsltComponent {
}
/**
- * To use a custom Saxon configuration
+ * To use a custom Saxon configuration. It is shared by all the endpoints
of this component that do not set their
+ * own. The secureProcessing option is applied to this configuration,
which Saxon uses by reference, so endpoints
+ * that share the same configuration must use the same secureProcessing
value.
*/
public void setSaxonConfiguration(Configuration saxonConfiguration) {
this.saxonConfiguration = saxonConfiguration;
diff --git
a/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpoint.java
b/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpoint.java
index f0579c004446..7f44022dccc2 100644
---
a/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpoint.java
+++
b/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpoint.java
@@ -143,7 +143,8 @@ public class XsltSaxonEndpoint extends XsltEndpoint {
}
/**
- * To use a custom Saxon configuration
+ * To use a custom Saxon configuration. The secureProcessing option is
applied to this configuration, which Saxon
+ * uses by reference, so endpoints that share the same configuration must
use the same secureProcessing value.
*/
public void setSaxonConfiguration(Configuration saxonConfiguration) {
this.saxonConfiguration = saxonConfiguration;
@@ -192,7 +193,8 @@ public class XsltSaxonEndpoint extends XsltEndpoint {
* Feature for XML secure processing (see javax.xml.XMLConstants). This is
enabled by default. However, when using
* Saxon Professional you may need to turn this off to allow Saxon to be
able to use Java extension functions. Note
* that turning it off also restores the previous, unrestricted parsing of
a {@code Source} message body that is
- * still to be parsed, so only do so for trusted input.
+ * still to be parsed, so only do so for trusted input. With a
saxonConfiguration, the feature is set on that
+ * configuration, so endpoints that share the same configuration must use
the same secureProcessing value.
*/
public void setSecureProcessing(boolean secureProcessing) {
this.secureProcessing = secureProcessing;
@@ -223,25 +225,32 @@ public class XsltSaxonEndpoint extends XsltEndpoint {
TransformerFactory factory = getTransformerFactory();
if (factory == null) {
- if (getTransformerFactoryClass() == null) {
+ final String factoryClassName = getTransformerFactoryClass() !=
null
+ ? getTransformerFactoryClass()
+ : ((XsltSaxonComponent)
getComponent()).getTransformerFactoryClass();
+ if (factoryClassName == null) {
factory = new TransformerFactoryImpl();
} else {
- Class<TransformerFactory> factoryClass =
resolver.resolveMandatoryClass(getTransformerFactoryClass(),
+ Class<TransformerFactory> factoryClass =
resolver.resolveMandatoryClass(factoryClassName,
TransformerFactory.class,
XsltSaxonComponent.class.getClassLoader());
LOG.debug("Using TransformerFactoryClass {}", factoryClass);
factory = injector.newInstance(factoryClass);
}
if (factory instanceof TransformerFactoryImpl tf) {
- XsltSaxonHelper.configureSecureProcessing(tf,
secureProcessing);
+ // a custom Saxon configuration replaces the configuration of
the factory, so secure processing is
+ // applied after it, and the explicit Saxon configuration
properties last
XsltSaxonHelper.registerSaxonConfiguration(tf,
saxonConfiguration);
+ XsltSaxonHelper.configureSecureProcessing(tf,
secureProcessing);
XsltSaxonHelper.registerSaxonConfigurationProperties(tf,
saxonConfigurationProperties);
XsltSaxonHelper.registerSaxonExtensionFunctions(tf,
saxonExtensionFunctions);
}
XsltSaxonHelper.configureExternalAccess(factory);
- final TransformerFactoryConfigurationStrategy strategy =
getTransformerFactoryConfigurationStrategy();
+ final TransformerFactoryConfigurationStrategy strategy =
getTransformerFactoryConfigurationStrategy() != null
+ ? getTransformerFactoryConfigurationStrategy()
+ : ((XsltSaxonComponent)
getComponent()).getTransformerFactoryConfigurationStrategy();
if (strategy != null) {
strategy.configure(factory, this);
}
diff --git
a/components/camel-xslt-saxon/src/test/java/org/apache/camel/component/xslt/saxon/XsltSaxonComponentFactoryOptionsTest.java
b/components/camel-xslt-saxon/src/test/java/org/apache/camel/component/xslt/saxon/XsltSaxonComponentFactoryOptionsTest.java
new file mode 100644
index 000000000000..de3b9e40b2ec
--- /dev/null
+++
b/components/camel-xslt-saxon/src/test/java/org/apache/camel/component/xslt/saxon/XsltSaxonComponentFactoryOptionsTest.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.xslt.saxon;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.transform.TransformerFactory;
+
+import net.sf.saxon.TransformerFactoryImpl;
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.component.xslt.TransformerFactoryConfigurationStrategy;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+
+/**
+ * The transformerFactoryConfigurationStrategy and transformerFactoryClass
options of the component apply to the
+ * endpoints that do not set their own.
+ */
+public class XsltSaxonComponentFactoryOptionsTest extends CamelTestSupport {
+
+ private static final String XSL = "xslt-saxon:xslt/transform.xsl";
+
+ private final List<TransformerFactory> configuredFactories = new
ArrayList<>();
+
+ @BindToRegistry("recordFactory")
+ private final TransformerFactoryConfigurationStrategy recordFactory
+ = (factory, endpoint) -> configuredFactories.add(factory);
+
+ @Test
+ public void componentStrategyIsAppliedToTheFactory() throws Exception {
+ context.getComponent("xslt-saxon", XsltSaxonComponent.class)
+ .setTransformerFactoryConfigurationStrategy(recordFactory);
+ addRouteAndSend(XSL);
+
+ assertEquals(1, configuredFactories.size());
+ assertInstanceOf(TransformerFactoryImpl.class,
configuredFactories.get(0));
+ }
+
+ @Test
+ public void componentTransformerFactoryClassIsUsed() throws Exception {
+ context.getComponent("xslt-saxon", XsltSaxonComponent.class)
+
.setTransformerFactoryClass(CustomTransformerFactory.class.getName());
+ addRouteAndSend(XSL +
"?transformerFactoryConfigurationStrategy=#recordFactory");
+
+ assertEquals(1, configuredFactories.size());
+ assertInstanceOf(CustomTransformerFactory.class,
configuredFactories.get(0));
+ }
+
+ private void addRouteAndSend(String uri) throws Exception {
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:start").to(uri).to("mock:result");
+ }
+ });
+
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedMessageCount(1);
+ template.sendBody("direct:start",
"<mail><subject>Hey</subject><body>Hello world!</body></mail>");
+ MockEndpoint.assertIsSatisfied(context);
+ }
+
+ public static class CustomTransformerFactory extends
TransformerFactoryImpl {
+ }
+}
diff --git
a/components/camel-xslt-saxon/src/test/java/org/apache/camel/component/xslt/saxon/XsltSaxonConfigurationSecureProcessingTest.java
b/components/camel-xslt-saxon/src/test/java/org/apache/camel/component/xslt/saxon/XsltSaxonConfigurationSecureProcessingTest.java
new file mode 100644
index 000000000000..91ad0b685ce5
--- /dev/null
+++
b/components/camel-xslt-saxon/src/test/java/org/apache/camel/component/xslt/saxon/XsltSaxonConfigurationSecureProcessingTest.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.xslt.saxon;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Map;
+
+import net.sf.saxon.Configuration;
+import net.sf.saxon.lib.FeatureKeys;
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * The secureProcessing option is applied on top of a custom Saxon
configuration. The stylesheet writes a result
+ * document, which Saxon refuses when extension functions are disabled by
secure processing.
+ */
+public class XsltSaxonConfigurationSecureProcessingTest extends
CamelTestSupport {
+
+ private static final String XSL
+ =
"xslt-saxon:org/apache/camel/component/xslt/saxon/result-document.xsl?saxonConfiguration=#saxonConfig";
+
+ @BindToRegistry("saxonConfig")
+ private final Configuration saxonConfig = new Configuration();
+
+ @BindToRegistry("allowExternalFunctions")
+ private final Map<String, Object> allowExternalFunctions =
Map.of(FeatureKeys.ALLOW_EXTERNAL_FUNCTIONS, true);
+
+ @TempDir
+ Path outDir;
+
+ @Test
+ public void secureProcessingIsAppliedWithSaxonConfiguration() {
+ Exception e = assertThrows(Exception.class, () -> addRoute(XSL));
+
+ Throwable root = e;
+ while (root.getCause() != null) {
+ root = root.getCause();
+ }
+ assertTrue(root.getMessage().contains("xsl:result-document is disabled
when extension functions are disabled"),
+ root.getMessage());
+ assertFalse(Files.exists(outDir.resolve("part.xml")));
+ }
+
+ @Test
+ public void secureProcessingCanBeTurnedOffWithSaxonConfiguration() throws
Exception {
+ addRoute(XSL + "&secureProcessing=false");
+
+ sendAndAssertResultDocument();
+ }
+
+ @Test
+ public void saxonConfigurationPropertiesOverrideSecureProcessing() throws
Exception {
+ addRoute(XSL +
"&saxonConfigurationProperties=#allowExternalFunctions");
+
+ sendAndAssertResultDocument();
+ }
+
+ private void addRoute(String uri) throws Exception {
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:start").to(uri).to("mock:result");
+ }
+ });
+ }
+
+ private void sendAndAssertResultDocument() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedMessageCount(1);
+ template.sendBodyAndHeader("direct:start", "<in/>", "outDir",
outDir.toUri().toString());
+ MockEndpoint.assertIsSatisfied(context);
+
+ String body =
mock.getReceivedExchanges().get(0).getIn().getBody(String.class);
+ assertTrue(body.contains("<done/>"), body);
+ String part = Files.readString(outDir.resolve("part.xml"));
+ assertTrue(part.contains("<part/>"), part);
+ }
+}
diff --git
a/components/camel-xslt-saxon/src/test/resources/org/apache/camel/component/xslt/saxon/result-document.xsl
b/components/camel-xslt-saxon/src/test/resources/org/apache/camel/component/xslt/saxon/result-document.xsl
new file mode 100644
index 000000000000..ad781cb6fdec
--- /dev/null
+++
b/components/camel-xslt-saxon/src/test/resources/org/apache/camel/component/xslt/saxon/result-document.xsl
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:param name="outDir"/>
+
+ <xsl:template match="/">
+ <done/>
+ <xsl:result-document href="{$outDir}part.xml">
+ <part/>
+ </xsl:result-document>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git
a/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java
b/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java
index c02124dc4569..1762ce12b37a 100644
---
a/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java
+++
b/components/camel-xslt/src/main/java/org/apache/camel/component/xslt/XsltEndpoint.java
@@ -482,16 +482,18 @@ public class XsltEndpoint extends ProcessorEndpoint {
? xpathTotalOpLimit
: ((XsltComponent) getComponent()).getXpathTotalOpLimit();
- // if xpathTotalOpLimit is configured but no factory was explicitly
set, create a default one
- // so we can set the limit per-factory instance instead of using a
JVM-global system property
- if (factory == null && effectiveXpathTotalOpLimit > 0) {
+ final TransformerFactoryConfigurationStrategy tfConfigStrategy =
transformerFactoryConfigurationStrategy != null
+ ? transformerFactoryConfigurationStrategy
+ : ((XsltComponent)
getComponent()).getTransformerFactoryConfigurationStrategy();
+
+ // if xpathTotalOpLimit or a configuration strategy is configured but
no factory was explicitly set, create the
+ // default one here, so we can set the limit per-factory instance
instead of using a JVM-global system property,
+ // and the strategy configures the factory that is used
+ if (factory == null && (effectiveXpathTotalOpLimit > 0 ||
tfConfigStrategy != null)) {
factory = new XMLConverterHelper().createTransformerFactory();
}
if (factory != null) {
- final TransformerFactoryConfigurationStrategy tfConfigStrategy =
transformerFactoryConfigurationStrategy != null
- ? transformerFactoryConfigurationStrategy
- : ((XsltComponent)
getComponent()).getTransformerFactoryConfigurationStrategy();
if (tfConfigStrategy != null) {
tfConfigStrategy.configure(factory, this);
}
diff --git
a/core/camel-core/src/test/java/org/apache/camel/component/xslt/XsltTransformerFactoryConfigurationStrategyTest.java
b/core/camel-core/src/test/java/org/apache/camel/component/xslt/XsltTransformerFactoryConfigurationStrategyTest.java
new file mode 100644
index 000000000000..25a9f8d0c711
--- /dev/null
+++
b/core/camel-core/src/test/java/org/apache/camel/component/xslt/XsltTransformerFactoryConfigurationStrategyTest.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.xslt;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.TransformerConfigurationException;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.spi.Registry;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+class XsltTransformerFactoryConfigurationStrategyTest extends
ContextTestSupport {
+
+ private static final String XSL =
"xslt:org/apache/camel/component/xslt/transformCallEcho.xsl";
+
+ private final AtomicInteger strategyCalls = new AtomicInteger();
+
+ @Override
+ public boolean isUseRouteBuilder() {
+ return false;
+ }
+
+ @Override
+ protected Registry createCamelRegistry() throws Exception {
+ Registry registry = super.createCamelRegistry();
+ registry.bind("allowExtensionFunctions", allowExtensionFunctions());
+ return registry;
+ }
+
+ @Test
+ void endpointStrategyIsAppliedToTheDefaultFactory() throws Exception {
+ startRoute(XSL +
"?transformerFactoryConfigurationStrategy=#allowExtensionFunctions");
+
+ assertTransformedWithExtensionFunction();
+ }
+
+ @Test
+ void componentStrategyIsAppliedToTheDefaultFactory() throws Exception {
+ context.getComponent("xslt", XsltComponent.class)
+
.setTransformerFactoryConfigurationStrategy(allowExtensionFunctions());
+ startRoute(XSL);
+
+ assertTransformedWithExtensionFunction();
+ }
+
+ /**
+ * A strategy that turns secure processing off, so that the stylesheet may
call its extension function.
+ */
+ private TransformerFactoryConfigurationStrategy allowExtensionFunctions() {
+ return (factory, endpoint) -> {
+ strategyCalls.incrementAndGet();
+ try {
+ factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING,
false);
+ } catch (TransformerConfigurationException e) {
+ throw new IllegalStateException(e);
+ }
+ };
+ }
+
+ private void startRoute(String uri) throws Exception {
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:start").to(uri).to("mock:result");
+ }
+ });
+ context.start();
+ }
+
+ private void assertTransformedWithExtensionFunction() throws Exception {
+ assertThat(strategyCalls).hasValue(1);
+
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedMessageCount(1);
+ template.sendBody("direct:start", "<name>Camel</name>");
+ MockEndpoint.assertIsSatisfied(context);
+
+
assertThat(mock.getReceivedExchanges().get(0).getIn().getBody(String.class))
+ .contains("<cheese>Camel</cheese>");
+ }
+}
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
index 0810f68e7692..8194594c0368 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
@@ -636,6 +636,22 @@ a Saxon PE/EE stylesheet can call Java extension
functions) also restores the pr
`Source` parsing: `setTransformerFactory(...)` replaces the factory, but the
strategy's `XsltSaxonBuilder` keeps
`secureProcessing=true`, so the body is still parsed with the restricted
reader.
+=== camel-xslt, camel-xslt-saxon - transformerFactoryConfigurationStrategy and
secureProcessing are applied in all configurations
+
+The `xslt` component now calls the `transformerFactoryConfigurationStrategy`
of the endpoint or the component also when
+no `transformerFactory`, `transformerFactoryClass` or `xpathTotalOpLimit` is
set. Before, the default
+`TransformerFactory` was used without calling the strategy. The `xslt-saxon`
component now also uses the
+`transformerFactoryConfigurationStrategy` and `transformerFactoryClass` set on
the component, which it ignored before;
+the endpoint options still take precedence.
+
+With a `saxonConfiguration` bean, the `xslt-saxon` component now applies
`secureProcessing` (default `true`) to that
+configuration. Before (since 4.22.0), the bean replaced the configuration
secure processing had been applied to, so a
+stylesheet could call extension functions or use `xsl:result-document`. If
such a stylesheet now fails to compile, set
+`secureProcessing=false`, or set the Saxon feature in
`saxonConfigurationProperties`, which is applied last.
+Saxon uses the bean by reference, so `secureProcessing` is set on the bean
itself: endpoints that share a
+`saxonConfiguration` (for example all the endpoints, when it is set on the
component) must use the same
+`secureProcessing` value, otherwise the endpoint created last sets it for all
of them.
+
=== camel-openstack - the remaining Swift header constants follow the Camel
naming convention
The four remaining Exchange header constants of `SwiftConstants` have been
renamed to follow the Camel naming
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
index db674818ec2c..37f01a4d2be3 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
@@ -421,6 +421,22 @@ file consumer no longer adds the key to the idempotent
repository eagerly, and `
read lock adds it when it acquires the lock. Since Camel 4.7 the read lock was
refused, and such a consumer never
consumed a file.
+=== camel-xslt, camel-xslt-saxon - transformerFactoryConfigurationStrategy and
secureProcessing are applied in all configurations
+
+The `xslt` component now calls the `transformerFactoryConfigurationStrategy`
of the endpoint or the component also when
+no `transformerFactory`, `transformerFactoryClass` or `xpathTotalOpLimit` is
set. Before, the default
+`TransformerFactory` was used without calling the strategy. The `xslt-saxon`
component now also uses the
+`transformerFactoryConfigurationStrategy` and `transformerFactoryClass` set on
the component, which it ignored before;
+the endpoint options still take precedence.
+
+With a `saxonConfiguration` bean, the `xslt-saxon` component now applies
`secureProcessing` (default `true`) to that
+configuration. Before (since 4.22), the bean replaced the configuration secure
processing had been applied to, so a
+stylesheet could call extension functions or use `xsl:result-document`. If
such a stylesheet now fails to compile, set
+`secureProcessing=false`, or set the Saxon feature in
`saxonConfigurationProperties`, which is applied last.
+Saxon uses the bean by reference, so `secureProcessing` is set on the bean
itself: endpoints that share a
+`saxonConfiguration` (for example all the endpoints, when it is set on the
component) must use the same
+`secureProcessing` value, otherwise the endpoint created last sets it for all
of them.
+
=== Java
*Breaking change:* Camel 4.24 requires *Java 21* as the minimum runtime
version.
diff --git
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/XjComponentBuilderFactory.java
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/XjComponentBuilderFactory.java
index ea4a532a2e35..76a0c8e3fd40 100644
---
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/XjComponentBuilderFactory.java
+++
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/XjComponentBuilderFactory.java
@@ -140,7 +140,11 @@ public interface XjComponentBuilderFactory {
}
/**
- * To use a custom Saxon configuration.
+ * To use a custom Saxon configuration. It is shared by all the
+ * endpoints of this component that do not set their own. The
+ * secureProcessing option is applied to this configuration, which
Saxon
+ * uses by reference, so endpoints that share the same configuration
+ * must use the same secureProcessing value.
*
* The option is a: <code>net.sf.saxon.Configuration</code>
* type.
@@ -284,7 +288,9 @@ public interface XjComponentBuilderFactory {
* need to turn this off to allow Saxon to be able to use Java
extension
* functions. Note that turning it off also restores the previous,
* unrestricted parsing of a Source message body that is still to be
- * parsed, so only do so for trusted input.
+ * parsed, so only do so for trusted input. With a saxonConfiguration,
+ * the feature is set on that configuration, so endpoints that share
the
+ * same configuration must use the same secureProcessing value.
*
* The option is a: <code>boolean</code> type.
*
diff --git
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/XsltSaxonComponentBuilderFactory.java
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/XsltSaxonComponentBuilderFactory.java
index 233a4924a638..eafbfd385ba2 100644
---
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/XsltSaxonComponentBuilderFactory.java
+++
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/XsltSaxonComponentBuilderFactory.java
@@ -140,7 +140,11 @@ public interface XsltSaxonComponentBuilderFactory {
}
/**
- * To use a custom Saxon configuration.
+ * To use a custom Saxon configuration. It is shared by all the
+ * endpoints of this component that do not set their own. The
+ * secureProcessing option is applied to this configuration, which
Saxon
+ * uses by reference, so endpoints that share the same configuration
+ * must use the same secureProcessing value.
*
* The option is a: <code>net.sf.saxon.Configuration</code>
* type.
@@ -284,7 +288,9 @@ public interface XsltSaxonComponentBuilderFactory {
* need to turn this off to allow Saxon to be able to use Java
extension
* functions. Note that turning it off also restores the previous,
* unrestricted parsing of a Source message body that is still to be
- * parsed, so only do so for trusted input.
+ * parsed, so only do so for trusted input. With a saxonConfiguration,
+ * the feature is set on that configuration, so endpoints that share
the
+ * same configuration must use the same secureProcessing value.
*
* The option is a: <code>boolean</code> type.
*
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/XJEndpointBuilderFactory.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/XJEndpointBuilderFactory.java
index 5e17fda3afdf..34e05c66f913 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/XJEndpointBuilderFactory.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/XJEndpointBuilderFactory.java
@@ -548,7 +548,10 @@ public interface XJEndpointBuilderFactory {
return this;
}
/**
- * To use a custom Saxon configuration.
+ * To use a custom Saxon configuration. The secureProcessing option is
+ * applied to this configuration, which Saxon uses by reference, so
+ * endpoints that share the same configuration must use the same
+ * secureProcessing value.
*
* The option is a: <code>net.sf.saxon.Configuration</code> type.
*
@@ -562,7 +565,10 @@ public interface XJEndpointBuilderFactory {
return this;
}
/**
- * To use a custom Saxon configuration.
+ * To use a custom Saxon configuration. The secureProcessing option is
+ * applied to this configuration, which Saxon uses by reference, so
+ * endpoints that share the same configuration must use the same
+ * secureProcessing value.
*
* The option will be converted to a
* <code>net.sf.saxon.Configuration</code> type.
@@ -769,7 +775,9 @@ public interface XJEndpointBuilderFactory {
* need to turn this off to allow Saxon to be able to use Java
extension
* functions. Note that turning it off also restores the previous,
* unrestricted parsing of a Source message body that is still to be
- * parsed, so only do so for trusted input.
+ * parsed, so only do so for trusted input. With a saxonConfiguration,
+ * the feature is set on that configuration, so endpoints that share
the
+ * same configuration must use the same secureProcessing value.
*
* The option is a: <code>boolean</code> type.
*
@@ -789,7 +797,9 @@ public interface XJEndpointBuilderFactory {
* need to turn this off to allow Saxon to be able to use Java
extension
* functions. Note that turning it off also restores the previous,
* unrestricted parsing of a Source message body that is still to be
- * parsed, so only do so for trusted input.
+ * parsed, so only do so for trusted input. With a saxonConfiguration,
+ * the feature is set on that configuration, so endpoints that share
the
+ * same configuration must use the same secureProcessing value.
*
* The option will be converted to a <code>boolean</code> type.
*
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/XsltSaxonEndpointBuilderFactory.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/XsltSaxonEndpointBuilderFactory.java
index ceeb7a033971..6586589ea1b4 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/XsltSaxonEndpointBuilderFactory.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/XsltSaxonEndpointBuilderFactory.java
@@ -516,7 +516,10 @@ public interface XsltSaxonEndpointBuilderFactory {
return this;
}
/**
- * To use a custom Saxon configuration.
+ * To use a custom Saxon configuration. The secureProcessing option is
+ * applied to this configuration, which Saxon uses by reference, so
+ * endpoints that share the same configuration must use the same
+ * secureProcessing value.
*
* The option is a: <code>net.sf.saxon.Configuration</code> type.
*
@@ -530,7 +533,10 @@ public interface XsltSaxonEndpointBuilderFactory {
return this;
}
/**
- * To use a custom Saxon configuration.
+ * To use a custom Saxon configuration. The secureProcessing option is
+ * applied to this configuration, which Saxon uses by reference, so
+ * endpoints that share the same configuration must use the same
+ * secureProcessing value.
*
* The option will be converted to a
* <code>net.sf.saxon.Configuration</code> type.
@@ -737,7 +743,9 @@ public interface XsltSaxonEndpointBuilderFactory {
* need to turn this off to allow Saxon to be able to use Java
extension
* functions. Note that turning it off also restores the previous,
* unrestricted parsing of a Source message body that is still to be
- * parsed, so only do so for trusted input.
+ * parsed, so only do so for trusted input. With a saxonConfiguration,
+ * the feature is set on that configuration, so endpoints that share
the
+ * same configuration must use the same secureProcessing value.
*
* The option is a: <code>boolean</code> type.
*
@@ -757,7 +765,9 @@ public interface XsltSaxonEndpointBuilderFactory {
* need to turn this off to allow Saxon to be able to use Java
extension
* functions. Note that turning it off also restores the previous,
* unrestricted parsing of a Source message body that is still to be
- * parsed, so only do so for trusted input.
+ * parsed, so only do so for trusted input. With a saxonConfiguration,
+ * the feature is set on that configuration, so endpoints that share
the
+ * same configuration must use the same secureProcessing value.
*
* The option will be converted to a <code>boolean</code> type.
*