3 Replies Latest reply: Aug 11, 2011 12:41 PM by 478686 RSS

    OSB/ALSB Split/Join for loop counter problem

    15060
      I'm hitting my head into the table on a "simple" problem that seems to have overcomplicated itself.

      I have a splitjoin which as a parallel for each loop. I've created a counter varible ($cnt) and set a start/end value. When the loop runs, those values are set correct, and the lop is executed only the number of times I expect. So far so good.

      However, because I have to use a counter variable, I have to select the data piece to process using the XPATH [$cnt] notion. And this is where I have a problem.

      If I type /data/event[1]/text() I get back the first event-element's text node. But if $cnt contains 1 and I type /data/event[$cnt]/text() I get ALL the text in ALL the event-elements?

      What am I missing here?
        <data>
          <event>tr5-zone5</event>
          <event>tr15-zone5</event>
        </data>
      I've created the following debug-log:
      <debug>
        <cnt>{$cnt}</cnt>
        <events>{$eventList}</events>
        <query>{$eventList/bind:event[$cnt]/text()}</query>
      </debug>
      Which returns the following:
        <cnt>1</cnt>
        <events>
          <anyType>
            <mes:event>tr5-zone5</mes:event>
            <mes:event>tr15-zone5</mes:event>
          </anyType>
        </events>
        <query>tr5-zone5tr15-zone5</query>
      Notice the last "query" element contains the text from both elements.