INT-3599/INT-2042: Improve XPathMessageSplitter

JIRA: https://jira.spring.io/browse/INT-2042,
https://jira.spring.io/browse/INT-3599

* Expose `outputProperties` for the `XPathMessageSplitter`
* Add `iterator` mode for the `XPathMessageSplitter`

Address PR comments

Doc Polishing
This commit is contained in:
Artem Bilan
2015-04-14 21:30:39 +03:00
committed by Gary Russell
parent 8059566b9b
commit 256ff4c46f
9 changed files with 306 additions and 73 deletions

View File

@@ -107,3 +107,12 @@ The `<int-amqp:outbound-gateway>` now supports `confirm-correlation-expression`
attributes with similar purpose as for `<int-amqp:outbound-channel-adapter>`.
See <<amqp>> for more information.
[[x4.2-xpath-splitter]]
==== XPath Splitter improvements
The `XPathMessageSplitter` (`<int-xml:xpath-splitter>`) now allows the configuration of `output-properties`
for the internal `javax.xml.transform.Transformer` and supports an `Iterator` mode (defaults to `true`) for the xpath
evaluation `org.w3c.dom.NodeList` result.
See <<xml-xpath-splitting>> for more information.

View File

@@ -687,6 +687,30 @@ XPath splitter namespace support allows the creation of a Message Endpoint with
</int-xml:xpath-splitter>
----
Starting with `version 4.2`, the `XPathMessageSplitter` exposes `outputProperties`
(such as `OutputKeys.OMIT_XML_DECLARATION`) property for the `javax.xml.transform.Transformer` instances when a
request `payload` isn't of `org.w3c.dom.Node` type:
[source,xml]
----
<util:properties id="outputProperties">
<beans:prop key="#{T (javax.xml.transform.OutputKeys).OMIT_XML_DECLARATION}">yes</beans:prop>
</util:properties>
<xpath-splitter input-channel="input"
output-properties="outputProperties">
<xpath-expression expression="/orders/order"/>
</xpath-splitter>
----
Starting with `version 4.2`, the `XPathMessageSplitter` exposes an `iterator` option as a `boolean` flag (defaults
to `true`).
This allows the "streaming" of split nodes in the downstream flow.
With the `iterator` mode, each node is transformed while iterating. When false, all entries are transformed first,
before the split nodes start being sent to the output channel (transform, send, transform, send Vs. transform,
transform, send, send).
See <<splitter>> for more information.
[[xml-xpath-routing]]
=== Routing XML Messages Using XPath