You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2022/09/03 10:50:00 UTC

[jira] [Commented] (CAMEL-17466) xtokenize does not select following siblings in mode "W"

    [ https://issues.apache.org/jira/browse/CAMEL-17466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17599886#comment-17599886 ] 

Claus Ibsen commented on CAMEL-17466:
-------------------------------------

Karen thanks for explaining. So lets keep this as-is

> xtokenize does not select following siblings in mode "W"
> --------------------------------------------------------
>
>                 Key: CAMEL-17466
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17466
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>         Environment: Servicemix 7.0.1 -> Camel 2.16.5
>            Reporter: Felix Hoßfeld
>            Priority: Minor
>             Fix For: 3.x
>
>
> 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. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)