You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2016/02/09 10:21:08 UTC

svn commit: r979924 [2/2] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache validation.html xslt.html

Modified: websites/production/camel/content/xslt.html
==============================================================================
--- websites/production/camel/content/xslt.html (original)
+++ websites/production/camel/content/xslt.html Tue Feb  9 09:21:07 2016
@@ -102,7 +102,7 @@
     <!-- use the same version as your Camel core version -->
 </dependency>
 ]]></script>
-</div></div><p>From Camel 2.9 onwards the <a shape="rect" href="xslt.html">XSLT</a> component is provided directly in the camel-core.</p><h3 id="XSLT-Options">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>converter</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Option to override default <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/converter/jaxp/XmlConverter.html">XmlConverter</a>. Will lookup for the converter in the <a shape="rect" href="registry.html">Registry</a>. The prov
 ided converted must be of type org.apache.camel.converter.jaxp.XmlConverter.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>transformerFactory</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Option to override default <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/TransformerFactory.html" rel="nofollow">TransformerFactory</a>. Will lookup for the transformerFactory in the <a shape="rect" href="registry.html">Registry</a>. The provided transformer factory must be of type javax.xml.transform.TransformerFactory.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>transformerFactoryClass</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Option to override default <a shape="rect" class="extern
 al-link" href="http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/TransformerFactory.html" rel="nofollow">TransformerFactory</a>. Will create a TransformerFactoryClass instance and set it to the converter.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>uriResolver</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.3</strong>: Allows you to use a custom <code>javax.xml.transformation.URIResolver</code>. Camel will by default use its own implementation <code>org.apache.camel.builder.xml.XsltUriResolver</code> which is capable of loading from classpath.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>resultHandlerFactory</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.3:</strong> Allows you to use a cust
 om <code>org.apache.camel.builder.xml.ResultHandlerFactory</code> which is capable of using custom <code>org.apache.camel.builder.xml.ResultHandler</code> types.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>failOnNullBody</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.3:</strong> Whether or not to throw an exception if the input body is null.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>deleteOutputFile</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.6:</strong> If you have <code>output=file</code> then this option dictates whether or not the output file should be deleted when the <a shape="rect" href="exchange.html">Exchange</a> 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.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>output</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>string</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.3:</strong> Option to specify which output type to use. Possible values are: <code>string, bytes, DOM, file</code>. The first three options are all in memory based, where as <code>file</code> is streamed directly to a <code>java.io.File</code>. For <code>file</code> you <strong>must</strong> specify the filename in the IN header with the key <code>Exchange.XSLT_FILE_NAME</code> which is also <code>CamelXsltFileName</code>. Also any paths leading to the filename must be created beforehand, otherwise an exception is thrown at runtime.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>contentCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><
 code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.6:</strong> Cache for the resource content (the stylesheet file) when it is loaded. If set to <code>false</code> Camel will reload the stylesheet file on each message processing. This is good for development. <br clear="none"> Note: from <strong>Camel 2.9</strong> a cached stylesheet can be forced to reload at runtime via JMX using the <code>clearCachedStylesheet</code> operation.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>allowStAX</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8.3/2.9:</strong> Whether to allow using StAX as the <code>javax.xml.transform.Source</code>. The option is default <code>false</code> in Camel 2.11.3/2.12.2 or older. And default <code>true</code> in Camel 2.11.4/2.12.3 onwards.</p></td></tr><tr><td colspan="1" rowspan="1" class="con
 fluenceTd"><p><code>transformerCacheSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9.3/2.10.1:</strong> The number of <code>javax.xml.transform.Transformer</code> object that are cached for reuse to avoid calls to <code>Template.newTransformer()</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>saxon</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11:</strong> Whether to use Saxon as the <code>transformerFactoryClass</code>. If enabled then the class <code>net.sf.saxon.TransformerFactoryImpl</code>. You would need to add Saxon to the classpath.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">errorListener</td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" class="conf
 luenceTd"><strong>Camel 2.14:</strong> Allows to configure to use a custom <code>javax.xml.transform.ErrorListener</code>. Beware when doing this then the default error listener which captures any errors or fatal errors and store information on the Exchange as properties is not in use. So only use this option for special use-cases.</td></tr></tbody></table></div></div><h3 id="XSLT-UsingXSLTendpoints">Using XSLT endpoints</h3><p>For example you could use something like</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>From Camel 2.9 onwards the <a shape="rect" href="xslt.html">XSLT</a> component is provided directly in the camel-core.</p><h3 id="XSLT-Options">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>converter</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Option to override default <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/converter/jaxp/XmlConverter.html">XmlConverter</a>. Will lookup for the converter in the <a shape="rect" href="registry.html">Registry</a>. The prov
 ided converted must be of type org.apache.camel.converter.jaxp.XmlConverter.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>transformerFactory</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Option to override default <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/TransformerFactory.html" rel="nofollow">TransformerFactory</a>. Will lookup for the transformerFactory in the <a shape="rect" href="registry.html">Registry</a>. The provided transformer factory must be of type javax.xml.transform.TransformerFactory.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>transformerFactoryClass</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Option to override default <a shape="rect" class="extern
 al-link" href="http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/TransformerFactory.html" rel="nofollow">TransformerFactory</a>. Will create a TransformerFactoryClass instance and set it to the converter.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>uriResolverFactory</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>DefaultXsltUriResolverFactory</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.17</strong>: <span style="color: rgb(51,51,51);">&#160;Reference to a&#160;</span><code style="text-align: left;">org.apache.camel.component.</code><code style="text-align: left;">xslt</code><code style="text-align: left;">.</code><span style="color: rgb(51,51,51);"><code>XsltUriResolverFactory</code> which creates an URI resolver per endpoint</span><code style="text-align: left;">.</code><span style="color: rgb(51,51,51);">The default implementation returns an instance of&#160;<code><span>org.apache.camel.compone
 nt.xslt.</span></code></span><span style="color: rgb(51,51,51);"><span><code>DefaultXsltUriResolverFactory</code> which creates the default URI resolver&#160;<span style="color: rgb(51,51,51);"><span><span style="color: rgb(51,51,51);"><code><span>org.apache.camel.builder.</span><span>xml</span></code></span>.XsltUriResolver</span></span> per endpoint. The default URI resolver reads XSLT documents from the classpath and the file system. This option instead of the option <code>uriResolver</code>&#160;shall be used when the URI resolver depends on the resource URI of the root XSLT document specified in the endpoint; for example, if you want to extend the default URI resolver. This option is also available on the XSLT component, so that you can set the resource resolver factory only once for all endpoints.</span></span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>uriResolver</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code><
 /p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.3</strong>: Allows you to use a custom <code>javax.xml.transformation.URIResolver</code>. Camel will by default use its own implementation <code>org.apache.camel.builder.xml.XsltUriResolver</code> which is capable of loading from classpath.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>resultHandlerFactory</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.3:</strong> Allows you to use a custom <code>org.apache.camel.builder.xml.ResultHandlerFactory</code> which is capable of using custom <code>org.apache.camel.builder.xml.ResultHandler</code> types.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>failOnNullBody</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="conflue
 nceTd"><p><strong>Camel 2.3:</strong> Whether or not to throw an exception if the input body is null.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>deleteOutputFile</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.6:</strong> If you have <code>output=file</code> then this option dictates whether or not the output file should be deleted when the <a shape="rect" href="exchange.html">Exchange</a> 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.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>output</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>string</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.3:</strong> Option to specify which output type to use. Possible values are: <code>st
 ring, bytes, DOM, file</code>. The first three options are all in memory based, where as <code>file</code> is streamed directly to a <code>java.io.File</code>. For <code>file</code> you <strong>must</strong> specify the filename in the IN header with the key <code>Exchange.XSLT_FILE_NAME</code> which is also <code>CamelXsltFileName</code>. Also any paths leading to the filename must be created beforehand, otherwise an exception is thrown at runtime.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>contentCache</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.6:</strong> Cache for the resource content (the stylesheet file) when it is loaded. If set to <code>false</code> Camel will reload the stylesheet file on each message processing. This is good for development. <br clear="none"> Note: from <strong>Camel 2.9</strong> a cached stylesheet can be fo
 rced to reload at runtime via JMX using the <code>clearCachedStylesheet</code> operation.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>allowStAX</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8.3/2.9:</strong> Whether to allow using StAX as the <code>javax.xml.transform.Source</code>. The option is default <code>false</code> in Camel 2.11.3/2.12.2 or older. And default <code>true</code> in Camel 2.11.4/2.12.3 onwards.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>transformerCacheSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9.3/2.10.1:</strong> The number of <code>javax.xml.transform.Transformer</code> object that are cached for reuse to avoid calls to <code>Template.newTransformer()</code>.</p></td></tr><tr>
 <td colspan="1" rowspan="1" class="confluenceTd"><p><code>saxon</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11:</strong> Whether to use Saxon as the <code>transformerFactoryClass</code>. If enabled then the class <code>net.sf.saxon.TransformerFactoryImpl</code>. You would need to add Saxon to the classpath.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">errorListener</td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.14:</strong> Allows to configure to use a custom <code>javax.xml.transform.ErrorListener</code>. Beware when doing this then the default error listener which captures any errors or fatal errors and store information on the Exchange as properties is not in use. So only use this option for special use-cases.</td></tr></tbody></table></div></div><h3 id="XSLT-Usi
 ngXSLTendpoints">Using XSLT endpoints</h3><p>For example you could use something like</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;activemq:My.Queue&quot;).
   to(&quot;xslt:com/acme/mytransform.xsl&quot;);
 ]]></script>