You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/09/20 06:40:33 UTC

[camel] branch master updated: CAMEL-13961: camel-xslt - The option allowStAX is now default false as not XSLT libraries support this out of the box.

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new e048337  CAMEL-13961: camel-xslt - The option allowStAX is now default false as not XSLT libraries support this out of the box.
e048337 is described below

commit e04833712609116be570fab3d0cfc020feae8fab
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Sep 20 08:39:29 2019 +0200

    CAMEL-13961: camel-xslt - The option allowStAX is now default false as not XSLT libraries support this out of the box.
---
 components/camel-xslt/src/main/docs/xslt-component.adoc        |  2 +-
 .../java/org/apache/camel/component/xslt/XsltEndpoint.java     |  6 ++++--
 .../camel/builder/endpoint/dsl/XsltEndpointBuilderFactory.java | 10 ++++++++--
 docs/components/modules/ROOT/pages/xslt-component.adoc         |  2 +-
 4 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/components/camel-xslt/src/main/docs/xslt-component.adoc b/components/camel-xslt/src/main/docs/xslt-component.adoc
index e4b1a5218..bdf85eb 100644
--- a/components/camel-xslt/src/main/docs/xslt-component.adoc
+++ b/components/camel-xslt/src/main/docs/xslt-component.adoc
@@ -84,7 +84,7 @@ with the following path and query parameters:
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *allowStAX* (producer) | Whether to allow using StAX as the javax.xml.transform.Source. | true | boolean
+| *allowStAX* (producer) | Whether to allow using StAX as the javax.xml.transform.Source. You can enable this if the XSLT library supports StAX such as the Saxon library (camel-saxon). The Xalan library (default in JVM) does not support StAXSource. | false | boolean
 | *contentCache* (producer) | 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 forced to reload at runtime via JMX using the clearCachedStylesheet operation. | true | boolean
 | *deleteOutputFile* (producer) | If you have output=file then this option dictates whether or not the output file should be deleted when the Exchange is done processing. For example suppose the output file is a temporary file, then it can be a good idea to delete it after use. | false | boolean
 | *failOnNullBody* (producer) | Whether or not to throw an exception if the input body is null. | true | boolean
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 888770a..5631a37 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
@@ -86,8 +86,8 @@ public class XsltEndpoint extends ProcessorEndpoint {
     private ErrorListener errorListener;
     @UriParam(label = "advanced")
     private URIResolver uriResolver;
-    @UriParam(defaultValue = "true", displayName = "Allow StAX")
-    private boolean allowStAX = true;
+    @UriParam(displayName = "Allow StAX")
+    private boolean allowStAX;
     @UriParam
     private boolean deleteOutputFile;
     @UriParam(label = "advanced")
@@ -336,6 +336,8 @@ public class XsltEndpoint extends ProcessorEndpoint {
 
     /**
      * Whether to allow using StAX as the javax.xml.transform.Source.
+     * You can enable this if the XSLT library supports StAX such as the Saxon library (camel-saxon).
+     * The Xalan library (default in JVM) does not support StAXSource.
      */
     public void setAllowStAX(boolean allowStAX) {
         this.allowStAX = allowStAX;
diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/XsltEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/XsltEndpointBuilderFactory.java
index 4d90dd0..ab6bf65 100644
--- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/XsltEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/XsltEndpointBuilderFactory.java
@@ -39,7 +39,10 @@ public interface XsltEndpointBuilderFactory {
             return (AdvancedXsltEndpointBuilder) this;
         }
         /**
-         * Whether to allow using StAX as the javax.xml.transform.Source.
+         * Whether to allow using StAX as the javax.xml.transform.Source. You
+         * can enable this if the XSLT library supports StAX such as the Saxon
+         * library (camel-saxon). The Xalan library (default in JVM) does not
+         * support StAXSource.
          * 
          * The option is a: <code>boolean</code> type.
          * 
@@ -50,7 +53,10 @@ public interface XsltEndpointBuilderFactory {
             return this;
         }
         /**
-         * Whether to allow using StAX as the javax.xml.transform.Source.
+         * Whether to allow using StAX as the javax.xml.transform.Source. You
+         * can enable this if the XSLT library supports StAX such as the Saxon
+         * library (camel-saxon). The Xalan library (default in JVM) does not
+         * support StAXSource.
          * 
          * The option will be converted to a <code>boolean</code> type.
          * 
diff --git a/docs/components/modules/ROOT/pages/xslt-component.adoc b/docs/components/modules/ROOT/pages/xslt-component.adoc
index 1eba369..4867410 100644
--- a/docs/components/modules/ROOT/pages/xslt-component.adoc
+++ b/docs/components/modules/ROOT/pages/xslt-component.adoc
@@ -85,7 +85,7 @@ with the following path and query parameters:
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *allowStAX* (producer) | Whether to allow using StAX as the javax.xml.transform.Source. | true | boolean
+| *allowStAX* (producer) | Whether to allow using StAX as the javax.xml.transform.Source. You can enable this if the XSLT library supports StAX such as the Saxon library (camel-saxon). The Xalan library (default in JVM) does not support StAXSource. | false | boolean
 | *contentCache* (producer) | 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 forced to reload at runtime via JMX using the clearCachedStylesheet operation. | true | boolean
 | *deleteOutputFile* (producer) | If you have output=file then this option dictates whether or not the output file should be deleted when the Exchange is done processing. For example suppose the output file is a temporary file, then it can be a good idea to delete it after use. | false | boolean
 | *failOnNullBody* (producer) | Whether or not to throw an exception if the input body is null. | true | boolean