INT-3067 Xslt method=text StringResult coercion
Previously there was a need to add `result-type="StringResult"` to <int-xml:xslt-transformer> for xslt output `method='text'` in case payload was non-standard type (e.g. `File`), if we wanted to get result as text. * Add coercion to `StringResult` code, if `Transformer`'s property `method` is 'text' and there is no explicit `resultFactory` provided. * Add documentation to reference manual JIRA: https://jira.springsource.org/browse/INT-3067
This commit is contained in:
committed by
Gunnar Hillert
parent
d549734837
commit
41fe514469
@@ -727,6 +727,22 @@
|
||||
<classname>String</classname>, the resulting payload will be of type
|
||||
<classname><ulink url="http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/Document.html">Document</ulink></classname>.
|
||||
</para>
|
||||
<para><emphasis>XsltPayloadTransformer and <xsl:output method="text"/></emphasis></para>
|
||||
<para><code><xsl:output method="text"/></code> tells the XSLT
|
||||
template to only produce text content from the input source.
|
||||
In this particuliar case there is no reason to have a
|
||||
<classname>DomResult</classname>. Therefore, the
|
||||
<classname><ulink url="http://static.springsource.org/spring-integration/api/org/springframework/integration/xml/transformer/XsltPayloadTransformer.html">XsltPayloadTransformer</ulink></classname>
|
||||
defaults to <classname>StringResult</classname> if the
|
||||
<ulink url="http://docs.oracle.com/javase/7/docs/api/javax/xml/transform/Transformer.html#getOutputProperties()">output property</ulink>
|
||||
called <code>method</code> of the underlying
|
||||
<classname>javax.xml.transform.Transformer</classname> returns <code>"text"</code>.
|
||||
This coercion is performed independent from the inbound payload type. Keep
|
||||
in mind that this <quote>smart</quote> behavior is only available, if the
|
||||
<code>result-type</code> or <code>result-factory</code> attributes
|
||||
aren't provided for the respective <code><int-xml:xslt-transformer></code>
|
||||
component.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
<section id="xml-xpath-transformer">
|
||||
|
||||
Reference in New Issue
Block a user