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 0c3b02a2e39 CAMEL-18492: camel-xslt-saxon - Allow to turn off secure 
processing that can be needed by Saxon Enterprise Edition
0c3b02a2e39 is described below

commit 0c3b02a2e39ee93c42c16e434c8defe2026fd482
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Sep 13 09:50:46 2022 +0200

    CAMEL-18492: camel-xslt-saxon - Allow to turn off secure processing that 
can be needed by Saxon Enterprise Edition
---
 .../camel/catalog/components/xslt-saxon.json       |  2 ++
 .../xslt/saxon/XsltSaxonComponentConfigurer.java   |  6 ++++
 .../xslt/saxon/XsltSaxonEndpointConfigurer.java    |  6 ++++
 .../xslt/saxon/XsltSaxonEndpointUriFactory.java    |  3 +-
 .../camel/component/xslt/saxon/xslt-saxon.json     |  2 ++
 .../component/xslt/saxon/XsltSaxonComponent.java   | 16 +++++++++
 .../component/xslt/saxon/XsltSaxonEndpoint.java    | 17 +++++++++-
 .../component/xslt/saxon/XsltSaxonHelper.java      |  7 ++--
 .../dsl/XsltSaxonComponentBuilderFactory.java      | 20 +++++++++++
 .../dsl/XsltSaxonEndpointBuilderFactory.java       | 39 ++++++++++++++++++++++
 10 files changed, 114 insertions(+), 4 deletions(-)

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 221cd231419..e74c818be3e 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,6 +28,7 @@
     "saxonConfiguration": { "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" },
     "saxonConfigurationProperties": { "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": { "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 
comma to separate multiple v [...]
+    "secureProcessing": { "kind": "property", "displayName": "Secure 
Processing", "group": "advanced", "label": "advanced", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": true, "description": "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 fu [...]
     "transformerFactoryClass": { "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" },
     "transformerFactoryConfigurationStrategy": { "kind": "property", 
"displayName": "Transformer Factory Configuration Strategy", "group": 
"advanced", "label": "advanced", "required": false, "type": "object", 
"javaType": 
"org.apache.camel.component.xslt.TransformerFactoryConfigurationStrategy", 
"deprecated": false, "autowired": false, "secret": false, "description": "A 
configuration strategy to apply on freshly created instances of 
TransformerFactory." },
     "uriResolver": { "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'." 
},
@@ -47,6 +48,7 @@
     "resultHandlerFactory": { "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": { "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" },
     "saxonExtensionFunctions": { "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 separate multiple  [...]
+    "secureProcessing": { "kind": "parameter", "displayName": "Secure 
Processing", "group": "advanced", "label": "advanced", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": true, "description": "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 f [...]
     "transformerFactory": { "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": { "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" },
     "transformerFactoryConfigurationStrategy": { "kind": "parameter", 
"displayName": "Transformer Factory Configuration Strategy", "group": 
"advanced", "label": "advanced", "required": false, "type": "object", 
"javaType": 
"org.apache.camel.component.xslt.TransformerFactoryConfigurationStrategy", 
"deprecated": false, "autowired": false, "secret": false, "description": "A 
configuration strategy to apply on freshly created instances of 
TransformerFactory." },
diff --git 
a/components/camel-xslt-saxon/src/generated/java/org/apache/camel/component/xslt/saxon/XsltSaxonComponentConfigurer.java
 
b/components/camel-xslt-saxon/src/generated/java/org/apache/camel/component/xslt/saxon/XsltSaxonComponentConfigurer.java
index ea450e803bf..bf8485a5392 100644
--- 
a/components/camel-xslt-saxon/src/generated/java/org/apache/camel/component/xslt/saxon/XsltSaxonComponentConfigurer.java
+++ 
b/components/camel-xslt-saxon/src/generated/java/org/apache/camel/component/xslt/saxon/XsltSaxonComponentConfigurer.java
@@ -27,6 +27,8 @@ public class XsltSaxonComponentConfigurer extends 
XsltComponentConfigurer implem
         case "saxonConfigurationProperties": 
target.setSaxonConfigurationProperties(property(camelContext, 
java.util.Map.class, value)); return true;
         case "saxonextensionfunctions":
         case "saxonExtensionFunctions": 
target.setSaxonExtensionFunctions(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "secureprocessing":
+        case "secureProcessing": 
target.setSecureProcessing(property(camelContext, boolean.class, value)); 
return true;
         default: return super.configure(camelContext, obj, name, value, 
ignoreCase);
         }
     }
@@ -40,6 +42,8 @@ public class XsltSaxonComponentConfigurer extends 
XsltComponentConfigurer implem
         case "saxonConfigurationProperties": return java.util.Map.class;
         case "saxonextensionfunctions":
         case "saxonExtensionFunctions": return java.lang.String.class;
+        case "secureprocessing":
+        case "secureProcessing": return boolean.class;
         default: return super.getOptionType(name, ignoreCase);
         }
     }
@@ -54,6 +58,8 @@ public class XsltSaxonComponentConfigurer extends 
XsltComponentConfigurer implem
         case "saxonConfigurationProperties": return 
target.getSaxonConfigurationProperties();
         case "saxonextensionfunctions":
         case "saxonExtensionFunctions": return 
target.getSaxonExtensionFunctions();
+        case "secureprocessing":
+        case "secureProcessing": return target.isSecureProcessing();
         default: return super.getOptionValue(obj, name, ignoreCase);
         }
     }
diff --git 
a/components/camel-xslt-saxon/src/generated/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpointConfigurer.java
 
b/components/camel-xslt-saxon/src/generated/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpointConfigurer.java
index 75f72a27856..11ec8cbfa53 100644
--- 
a/components/camel-xslt-saxon/src/generated/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpointConfigurer.java
+++ 
b/components/camel-xslt-saxon/src/generated/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpointConfigurer.java
@@ -27,6 +27,8 @@ public class XsltSaxonEndpointConfigurer extends 
XsltEndpointConfigurer implemen
         case "saxonConfiguration": 
target.setSaxonConfiguration(property(camelContext, 
net.sf.saxon.Configuration.class, value)); return true;
         case "saxonextensionfunctions":
         case "saxonExtensionFunctions": 
target.setSaxonExtensionFunctions(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "secureprocessing":
+        case "secureProcessing": 
target.setSecureProcessing(property(camelContext, boolean.class, value)); 
return true;
         default: return super.configure(camelContext, obj, name, value, 
ignoreCase);
         }
     }
@@ -40,6 +42,8 @@ public class XsltSaxonEndpointConfigurer extends 
XsltEndpointConfigurer implemen
         case "saxonConfiguration": return net.sf.saxon.Configuration.class;
         case "saxonextensionfunctions":
         case "saxonExtensionFunctions": return java.lang.String.class;
+        case "secureprocessing":
+        case "secureProcessing": return boolean.class;
         default: return super.getOptionType(name, ignoreCase);
         }
     }
@@ -54,6 +58,8 @@ public class XsltSaxonEndpointConfigurer extends 
XsltEndpointConfigurer implemen
         case "saxonConfiguration": return target.getSaxonConfiguration();
         case "saxonextensionfunctions":
         case "saxonExtensionFunctions": return 
target.getSaxonExtensionFunctions();
+        case "secureprocessing":
+        case "secureProcessing": return target.isSecureProcessing();
         default: return super.getOptionValue(obj, name, ignoreCase);
         }
     }
diff --git 
a/components/camel-xslt-saxon/src/generated/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpointUriFactory.java
 
b/components/camel-xslt-saxon/src/generated/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpointUriFactory.java
index c145f29bedb..c400ffe264a 100644
--- 
a/components/camel-xslt-saxon/src/generated/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpointUriFactory.java
+++ 
b/components/camel-xslt-saxon/src/generated/java/org/apache/camel/component/xslt/saxon/XsltSaxonEndpointUriFactory.java
@@ -21,7 +21,7 @@ public class XsltSaxonEndpointUriFactory extends 
org.apache.camel.support.compon
     private static final Set<String> SECRET_PROPERTY_NAMES;
     private static final Set<String> MULTI_VALUE_PREFIXES;
     static {
-        Set<String> props = new HashSet<>(17);
+        Set<String> props = new HashSet<>(18);
         props.add("allowStAX");
         props.add("contentCache");
         props.add("deleteOutputFile");
@@ -34,6 +34,7 @@ public class XsltSaxonEndpointUriFactory extends 
org.apache.camel.support.compon
         props.add("resultHandlerFactory");
         props.add("saxonConfiguration");
         props.add("saxonExtensionFunctions");
+        props.add("secureProcessing");
         props.add("transformerCacheSize");
         props.add("transformerFactory");
         props.add("transformerFactoryClass");
diff --git 
a/components/camel-xslt-saxon/src/generated/resources/org/apache/camel/component/xslt/saxon/xslt-saxon.json
 
b/components/camel-xslt-saxon/src/generated/resources/org/apache/camel/component/xslt/saxon/xslt-saxon.json
index 221cd231419..e74c818be3e 100644
--- 
a/components/camel-xslt-saxon/src/generated/resources/org/apache/camel/component/xslt/saxon/xslt-saxon.json
+++ 
b/components/camel-xslt-saxon/src/generated/resources/org/apache/camel/component/xslt/saxon/xslt-saxon.json
@@ -28,6 +28,7 @@
     "saxonConfiguration": { "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" },
     "saxonConfigurationProperties": { "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": { "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 
comma to separate multiple v [...]
+    "secureProcessing": { "kind": "property", "displayName": "Secure 
Processing", "group": "advanced", "label": "advanced", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": true, "description": "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 fu [...]
     "transformerFactoryClass": { "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" },
     "transformerFactoryConfigurationStrategy": { "kind": "property", 
"displayName": "Transformer Factory Configuration Strategy", "group": 
"advanced", "label": "advanced", "required": false, "type": "object", 
"javaType": 
"org.apache.camel.component.xslt.TransformerFactoryConfigurationStrategy", 
"deprecated": false, "autowired": false, "secret": false, "description": "A 
configuration strategy to apply on freshly created instances of 
TransformerFactory." },
     "uriResolver": { "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'." 
},
@@ -47,6 +48,7 @@
     "resultHandlerFactory": { "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": { "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" },
     "saxonExtensionFunctions": { "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 separate multiple  [...]
+    "secureProcessing": { "kind": "parameter", "displayName": "Secure 
Processing", "group": "advanced", "label": "advanced", "required": false, 
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": true, "description": "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 f [...]
     "transformerFactory": { "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": { "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" },
     "transformerFactoryConfigurationStrategy": { "kind": "parameter", 
"displayName": "Transformer Factory Configuration Strategy", "group": 
"advanced", "label": "advanced", "required": false, "type": "object", 
"javaType": 
"org.apache.camel.component.xslt.TransformerFactoryConfigurationStrategy", 
"deprecated": false, "autowired": false, "secret": false, "description": "A 
configuration strategy to apply on freshly created instances of 
TransformerFactory." },
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 c25b1fce603..43622304cb9 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
@@ -39,6 +39,8 @@ public class XsltSaxonComponent extends XsltComponent {
     private Map<String, Object> saxonConfigurationProperties = new HashMap<>();
     @Metadata(label = "advanced", javaType = "java.lang.String")
     private List<Object> saxonExtensionFunctions;
+    @Metadata(label = "advanced", defaultValue = "true")
+    private boolean secureProcessing = true;
 
     public List<Object> getSaxonExtensionFunctions() {
         return saxonExtensionFunctions;
@@ -63,6 +65,19 @@ public class XsltSaxonComponent extends XsltComponent {
                 Object.class);
     }
 
+    public boolean isSecureProcessing() {
+        return secureProcessing;
+    }
+
+    /**
+     * 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.
+     */
+    public void setSecureProcessing(boolean secureProcessing) {
+        this.secureProcessing = secureProcessing;
+    }
+
     public Configuration getSaxonConfiguration() {
         return saxonConfiguration;
     }
@@ -98,6 +113,7 @@ public class XsltSaxonComponent extends XsltComponent {
         saxon.setSaxonConfiguration(saxonConfiguration);
         saxon.setSaxonConfigurationProperties(saxonConfigurationProperties);
         saxon.setSaxonExtensionFunctions(saxonExtensionFunctions);
+        saxon.setSecureProcessing(secureProcessing);
 
         super.configureEndpoint(endpoint, remaining, parameters);
     }
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 292875463e1..d9681d8f54a 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
@@ -72,6 +72,8 @@ public class XsltSaxonEndpoint extends XsltEndpoint {
     private List<Object> saxonExtensionFunctions;
     @UriParam(displayName = "Allow StAX", defaultValue = "true")
     private boolean allowStAX = true;
+    @UriParam(label = "advanced", defaultValue = "true")
+    private boolean secureProcessing = true;
 
     public XsltSaxonEndpoint(String endpointUri, Component component) {
         super(endpointUri, component);
@@ -146,6 +148,19 @@ public class XsltSaxonEndpoint extends XsltEndpoint {
         this.allowStAX = allowStAX;
     }
 
+    public boolean isSecureProcessing() {
+        return secureProcessing;
+    }
+
+    /**
+     * 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.
+     */
+    public void setSecureProcessing(boolean secureProcessing) {
+        this.secureProcessing = secureProcessing;
+    }
+
     @Override
     protected void doInit() throws Exception {
         super.doInit();
@@ -199,7 +214,7 @@ public class XsltSaxonEndpoint extends XsltEndpoint {
             TransformerFactoryImpl tf = (TransformerFactoryImpl) factory;
             XsltSaxonHelper.registerSaxonConfiguration(tf, saxonConfiguration);
             XsltSaxonHelper.registerSaxonConfigurationProperties(tf, 
saxonConfigurationProperties);
-            XsltSaxonHelper.registerSaxonExtensionFunctions(tf, 
saxonExtensionFunctions);
+            XsltSaxonHelper.registerSaxonExtensionFunctions(tf, 
saxonExtensionFunctions, secureProcessing);
         }
 
         if (factory != null) {
diff --git 
a/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonHelper.java
 
b/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonHelper.java
index b8fa2c4d37f..978f2142f1b 100644
--- 
a/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonHelper.java
+++ 
b/components/camel-xslt-saxon/src/main/java/org/apache/camel/component/xslt/saxon/XsltSaxonHelper.java
@@ -28,6 +28,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 final class XsltSaxonHelper {
+
     private static final Logger LOG = 
LoggerFactory.getLogger(XsltSaxonHelper.class);
 
     private XsltSaxonHelper() {
@@ -49,10 +50,12 @@ final class XsltSaxonHelper {
         }
     }
 
-    public static void registerSaxonExtensionFunctions(TransformerFactoryImpl 
factory, List<Object> saxonExtensionFunctions)
+    public static void registerSaxonExtensionFunctions(TransformerFactoryImpl 
factory,
+                                                       List<Object> 
saxonExtensionFunctions,
+                                                       boolean 
secureProcessing)
             throws Exception {
         if (saxonExtensionFunctions != null && 
!saxonExtensionFunctions.isEmpty()) {
-            factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+            factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, 
secureProcessing);
             for (Object extensionFunction : saxonExtensionFunctions) {
                 if (extensionFunction instanceof ExtensionFunctionDefinition) {
                     LOG.debug("Saxon.registerExtensionFunction {}", 
extensionFunction);
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 628f10e5cfe..54a1ccb6454 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
@@ -164,6 +164,25 @@ public interface XsltSaxonComponentBuilderFactory {
             doSetProperty("saxonExtensionFunctions", saxonExtensionFunctions);
             return this;
         }
+        /**
+         * 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.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: true
+         * Group: advanced
+         * 
+         * @param secureProcessing the value to set
+         * @return the dsl builder
+         */
+        default XsltSaxonComponentBuilder secureProcessing(
+                boolean secureProcessing) {
+            doSetProperty("secureProcessing", secureProcessing);
+            return this;
+        }
         /**
          * To use a custom XSLT transformer factory, specified as a FQN class
          * name.
@@ -255,6 +274,7 @@ public interface XsltSaxonComponentBuilderFactory {
             case "saxonConfiguration": ((XsltSaxonComponent) 
component).setSaxonConfiguration((net.sf.saxon.Configuration) value); return 
true;
             case "saxonConfigurationProperties": ((XsltSaxonComponent) 
component).setSaxonConfigurationProperties((java.util.Map) value); return true;
             case "saxonExtensionFunctions": ((XsltSaxonComponent) 
component).setSaxonExtensionFunctions((java.lang.String) value); return true;
+            case "secureProcessing": ((XsltSaxonComponent) 
component).setSecureProcessing((boolean) value); return true;
             case "transformerFactoryClass": ((XsltSaxonComponent) 
component).setTransformerFactoryClass((java.lang.String) value); return true;
             case "transformerFactoryConfigurationStrategy": 
((XsltSaxonComponent) 
component).setTransformerFactoryConfigurationStrategy((org.apache.camel.component.xslt.TransformerFactoryConfigurationStrategy)
 value); return true;
             case "uriResolver": ((XsltSaxonComponent) 
component).setUriResolver((javax.xml.transform.URIResolver) value); return true;
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 56602d19362..03ea5b716af 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
@@ -488,6 +488,45 @@ public interface XsltSaxonEndpointBuilderFactory {
             doSetProperty("saxonExtensionFunctions", saxonExtensionFunctions);
             return this;
         }
+        /**
+         * 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.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: true
+         * Group: advanced
+         * 
+         * @param secureProcessing the value to set
+         * @return the dsl builder
+         */
+        default AdvancedXsltSaxonEndpointBuilder secureProcessing(
+                boolean secureProcessing) {
+            doSetProperty("secureProcessing", secureProcessing);
+            return this;
+        }
+        /**
+         * 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.
+         * 
+         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
+         * type.
+         * 
+         * Default: true
+         * Group: advanced
+         * 
+         * @param secureProcessing the value to set
+         * @return the dsl builder
+         */
+        default AdvancedXsltSaxonEndpointBuilder secureProcessing(
+                String secureProcessing) {
+            doSetProperty("secureProcessing", secureProcessing);
+            return this;
+        }
         /**
          * To use a custom XSLT transformer factory.
          * 

Reply via email to