Re: Here's a tricky one

/ Norman Walsh <ndw@nwalsh.com> was heard to say:
| / Alessandro Vernet <avernet@orbeon.com> was heard to say:
| | That part is fine, but what surprises me is XPath expression itself:
| | "$p:episode". The step receives this as a string. When it evaluates
| | that expression why would there be a $p:episode variable? This is not
| | an XPath expression evaluated by the pipeline engine, but by a
| | component. For this to work, the pipeline engine would need somehow to
| | expose the state variables to the component, and the component to
| | expose those states variables as XPath variables when evaluating XPath
| | expressions.
[...]
| Yes. And maybe I've changed my mind. In reply to her message, I said
| that I thought we should expose them, but now I'm thinking maybe we
| don't have to.

Ah, but then how do we make this work?

<p:matching-documents>
  <p:input port="source">
    <p:inline>
      <odd/>
    </p:inline>
    <p:inline>
      <even/>
    </p:inline>
    <p:inline>
      <odd/>
    </p:inline>
    <p:inline>
      <even/>
    </p:inline>
    <p:inline>
      <odd/>
    </p:inline>
  </p:input>
  <p:option name="test" value="$p:position mod 2 = 1"/>
</p:matching-documents>

We added $p:position for this very case.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | Everything should be made as simple as
http://nwalsh.com/            | possible, but no simpler.

Received on Monday, 14 May 2007 13:48:12 UTC