I think you are right.
currently, the result is a series of child elements and the parent
context information is not included in the result (except the
namespace binding information that can be extracted into the split
child elements).

When I pushed the current implementation, I had the code sitting
around in my repo to add such options of either wrapping the child
with the its parent container part or set the parent container part in
a separate header. But I didn't push that part, as I was not sure
about whether this was useful (I mean, to be included directly in the
splitter, as opposed to have this parent extraction step separately)
and how to expose the configuration parameter for it.

Probably including the extraction in the splitter is a good idea. I'll
look at it again.
regards, aki



2014-04-15 12:04 GMT+02:00 cgiera <christoph.gi...@mic-cust.com>:
> Hello,
>
> I have to deal with large xml data in our camel application. In the camel
> documentation I've found the splitting with the
> xmltokenizer(split().xmlTokenize(<tag>)).
> First it looked fine for me, but then I noticed that there is no possibility
> to add the root element to the splitted xml's.
>
> Xml looks like this:
> <root>
>   <tosplit>
>   </tosplit>
>   <tosplit>
>   </tosplit>
>   <tosplit>
>   </tosplit>
>   <tosplit>
>   </tosplit>
> ...
> </root>
>
> Output of xmltokenize("tosplit"):
> 1. xml:
> <tosplit>
> </tosplit>
> 2. xml:
> <tosplit>
> </tosplit>
> ...
>
> Output needed:
> 1. xml:
> <root>
>   <tosplit>
>   </tosplit>
> <root>
> 2. xml:
> <root>
>   <tosplit>
>   </tosplit>
> <root>
> ...
>
> Maybe I missed something in the camel docu, is there a way in camel to get
> the output from above?
> Perhaps I can use something other than the xmltokenizer?
>
> kind regards,
> Christoph
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Split-XML-with-xmlTokenizer-and-add-root-element-tp5750237.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to