Modified: websites/production/camel/content/xslt.html
==============================================================================
--- websites/production/camel/content/xslt.html (original)
+++ websites/production/camel/content/xslt.html Fri Feb 12 11:22:26 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"><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">
+</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"><span>saxonExtensionFunctions</span></td><td colspan="1" 
rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1" 
class="confluenceTd"><strong>Camel 2.17:</strong><span> <span>Allows to 
configure one or more custom 
net.sf.saxon.lib.ExtensionFunctionDefinition<span>. You would need to add Saxon 
to the classpath. By setting this option, saxon option will be turned out 
automatically.</span></span></span></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd">errorListener</td><td co
 lspan="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-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">
 <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>
@@ -155,7 +155,31 @@
 </div></div><p>From Camel 2.10.4 onwards we have made this easier as Camel 
will use the prefix from the endpoint configuration as the default prefix. So 
from Camel 2.10.4 onwards you can do:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;xsl:include 
href=&quot;staff_template.xsl&quot;/&gt;
 ]]></script>
-</div></div><p>Which will load the staff_template.xsl resource from the file 
system, as the endpoint was configured with "file:" as prefix.<br clear="none"> 
You can still though explicit configure a prefix, and then mix and match. And 
have both file and classpath loading. But that would be unusual, as most people 
either use file or classpath based resources.</p><h3 
id="XSLT-Dynamicstylesheets">Dynamic stylesheets</h3><p>To provide a dynamic 
stylesheet at runtime you can define a dynamic URI. See&#160;<a shape="rect" 
href="how-to-use-a-dynamic-uri-in-to.html">How to use a dynamic URI in to()</a> 
for more information.</p><p><strong>Available as of Camel 2.9 (removed in 
2.11.4, 2.12.3 and 2.13.0)</strong><br clear="none"> Camel provides the 
<code>CamelXsltResourceUri</code> header which you can use to define a 
stylesheet to use instead of what is configured on the endpoint URI. This 
allows you to provide a dynamic stylesheet at runtime.</p><h3 
id="XSLT-Accessingwarnings,errorsandfatalE
 rrorsfromXSLTErrorListener">Accessing warnings, errors and fatalErrors from 
XSLT ErrorListener</h3><p><strong>Available as of Camel 
2.14</strong></p><p>From Camel 2.14 onwards, any warning/error or fatalError is 
stored on the current Exchange as a property with the 
keys&#160;<code>Exchange.XSLT_ERROR</code>,&#160;<code>Exchange.XSLT_FATAL_ERROR</code>,
 or&#160;<code>Exchange.XSLT_WARNING</code> which allows end users to get hold 
of any errors happening during transformation.</p><p>For example in the 
stylesheet below, we want to terminate if a staff has an empty dob field. And 
to include a custom error message using xsl:message.</p><div class="code panel 
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>Which will load the staff_template.xsl resource from the file 
system, as the endpoint was configured with "file:" as prefix.<br clear="none"> 
You can still though explicit configure a prefix, and then mix and match. And 
have both file and classpath loading. But that would be unusual, as most people 
either use file or classpath based resources.</p><h3 
id="XSLT-UsingSaxonextensionfunctions">Using Saxon extension 
functions</h3><p>Since Saxon 9.2, writing extension functions has been 
supplemented by a new mechanism, referred to as&#160;<a shape="rect" 
class="external-link" 
href="http://www.saxonica.com/html/documentation/extensibility/integratedfunctions";
 rel="nofollow" title="Follow link">integrated extension functions</a>&#160;you 
can now easily use camel:</p><div><p>&#160;</p><p>-&#160;Java example:</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[SimpleRegistry registry = new 
SimpleRegistry();
+registry.put(&quot;function1&quot;, new MyExtensionFunction1());
+registry.put(&quot;function2&quot;, new MyExtensionFunction2());
+
+CamelContext context = new DefaultCamelContext(registry);
+context.addRoutes(new RouteBuilder() {
+    @Override
+    public void configure() throws Exception {
+        from(&quot;direct:start&quot;)
+            
.to(&quot;xslt:org/apache/camel/component/xslt/extensions/extensions.xslt?saxonExtensionFunctions=#function1,#function2&quot;);
+    }
+});]]></script>
+</div></div><p>&#160;</p><p>Spring example:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;camelContext 
xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
+  &lt;route&gt;
+    &lt;from uri=&quot;direct:extensions&quot;/&gt;
+    &lt;to 
uri=&quot;xslt:org/apache/camel/component/xslt/extensions/extensions.xslt?saxonExtensionFunctions=#function1,#function2&quot;/&gt;
+  &lt;/route&gt;
+&lt;/camelContext&gt;
+
+
+&lt;bean id=&quot;function1&quot; 
class=&quot;org.apache.camel.component.xslt.extensions.MyExtensionFunction1&quot;/&gt;
+&lt;bean id=&quot;function2&quot; 
class=&quot;org.apache.camel.component.xslt.extensions.MyExtensionFunction2&quot;/&gt;]]></script>
+</div></div><p>&#160;</p></div><p>&#160;</p><h3 
id="XSLT-Dynamicstylesheets">Dynamic stylesheets</h3><p>To provide a dynamic 
stylesheet at runtime you can define a dynamic URI. See&#160;<a shape="rect" 
href="how-to-use-a-dynamic-uri-in-to.html">How to use a dynamic URI in to()</a> 
for more information.</p><p><strong>Available as of Camel 2.9 (removed in 
2.11.4, 2.12.3 and 2.13.0)</strong><br clear="none"> Camel provides the 
<code>CamelXsltResourceUri</code> header which you can use to define a 
stylesheet to use instead of what is configured on the endpoint URI. This 
allows you to provide a dynamic stylesheet at runtime.</p><h3 
id="XSLT-Accessingwarnings,errorsandfatalErrorsfromXSLTErrorListener">Accessing 
warnings, errors and fatalErrors from XSLT 
ErrorListener</h3><p><strong>Available as of Camel 2.14</strong></p><p>From 
Camel 2.14 onwards, any warning/error or fatalError is stored on the current 
Exchange as a property with the 
keys&#160;<code>Exchange.XSLT_ERROR</code>,&#160;<code
 >Exchange.XSLT_FATAL_ERROR</code>, or&#160;<code>Exchange.XSLT_WARNING</code> 
 >which allows end users to get hold of any errors happening during 
 >transformation.</p><p>For example in the stylesheet below, we want to 
 >terminate if a staff has an empty dob field. And to include a custom error 
 >message using xsl:message.</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[  &lt;xsl:template match=&quot;/&quot;&gt;
     &lt;html&gt;
       &lt;body&gt;


Reply via email to