Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-17466

xtokenize does not select following siblings in mode "W"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Information Provided
    • None
    • 3.x
    • camel-core
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            fhossfel Felix Hoßfeld
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: