xpath-splitter and empty xpath result
Hello.
My goal is to process some XML like
Code:
<items>
<item>value1</item>
<item>value2</item>
<item>value3</item>
</items>
And convert it to a List of my beans that could be created with static MyBean.create(String).
Here is a context fragment:
Code:
<int:chain input-channel="..." output-channel="...">
<int-xml:xpath-splitter>
<int-xml:xpath-expression expression="/items/item" />
</int-xml:xpath-splitter>
<int-xml:xpath-transformer evaluation-type="STRING_RESULT" xpath-expression="/" />
<int:transformer expression="T(MyBean).create(payload)" />
<int:aggregator />
</int:chain>
It works quite well when the input message contains some items. But I'm failed to get an empty list when the message doesn't contains any items.
As far as I understand from code, XPathMessageSplitter throws an exception when the result collection is empty. Is there any way to work around that?
Regards,
-- Alexey