Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Information Provided
-
None
-
None
-
Servicemix 7.0.1 -> Camel 2.16.5
Description
Given the following XML:
<root>
<Level1>
<Level2preceding>Included</Level2preceding>
<Level2>
<data>Hello, World!</data>
<data>Hello, Camel!</data>
<data>Hello, Apache Foundation!</data>
</Level2>
<Level2following>Not Included</Level2following>
</Level1>
</root>
and the following xtokenizer:
<xtokenize mode="w">/root/Leve1/Level2/data</xtokenize>
will yield the following result:
<root>
<Level1>
<Level2preceding>Included</Level2preceding>
<Level2>
<data>Hello, World!</data>
</Level2>
</Level1>
</root>
Please note that the node <Level2following/> is missing while <Level2preceding/> is included. Since both nodes are a child of <Level1/> the tokenizer should include <Level2following/>, too, since they are a child of a ancestor of the <data/> node which the splitter processes.
The documentation mentions that the mode "w" will include the node in its ancestor content. Strictly speaking, the XPath ancestor would exclude <Level2preceding>. If I understand the XPath spec correctly the current implementation uses ancestor:: | preceding:: as the wrapper which it is a bit counterintuitive.