Hi,
using the split tag creates multiple messages depending on how much
elements there are, and these messages are processed one by one.
from("file:orders.xml").split().xpath("/orders/order") ...
that means the endpoint after the split is called multiple times (with
every message)
Now you can write that messages to a file:
...
.to("file://orders/")
which would create files with a generated filename. If you want your own
filename you need something unique to set it. For example if you have an
order-id within your order-tag you could use that:
setHeader(Exchange.FILE_NAME).xpath(/order/order_id/text(), String.class)
.to("file://orders/")
I hope that helps,
regards, Marco
Am 10.05.2012 10:51, schrieb Salomon:
I didn't understand very well your solution.
In your case, I need to know how many tags I have, otherwise it doesn't
work, for example: if I add tags without change the code. 'cause your idea
is to split tags one by one...right?
It does not exist a solution which separate automatically every tags, in a
node, in differents files?
--
View this message in context:
http://camel.465427.n5.nabble.com/Separate-XML-tags-with-splitter-tp5699358p5699571.html
Sent from the Camel - Users mailing list archive at Nabble.com.