nhajratw
Oct 7th, 2009, 10:51 AM
I have a scenario where an xml feed comes in with the following structure
<root>
<source>Vendor #1</source>
<objects>
<object>object 1</object>
<object>object 2</object>
<object>object 3</object>
<object>object 4</object>
</objects>
</root>
I have my spring-integration set up such that the incoming XML is split (using XPathSplitter) and then each <object> node is processed by a Transformer.
What I need to be able to do is keep track of which <source> the <object> came from when I am transforming it, but that information is currently lost by the time i get to the transformer.
My initial thought was to subclass the XPathSplitter and have it add a MessageHeader containing the <source> to each of the split messages, but I couldn't figure out where the Headers were actually set in that process.
Anyone have other ideas?
Thanks!
<root>
<source>Vendor #1</source>
<objects>
<object>object 1</object>
<object>object 2</object>
<object>object 3</object>
<object>object 4</object>
</objects>
</root>
I have my spring-integration set up such that the incoming XML is split (using XPathSplitter) and then each <object> node is processed by a Transformer.
What I need to be able to do is keep track of which <source> the <object> came from when I am transforming it, but that information is currently lost by the time i get to the transformer.
My initial thought was to subclass the XPathSplitter and have it add a MessageHeader containing the <source> to each of the split messages, but I couldn't figure out where the Headers were actually set in that process.
Anyone have other ideas?
Thanks!