Re: Evaluating replace on string-replace

Even there,

It is not clear to me that from *inside* the p:string-replace, the
XPath evaluation can see the $opos variable

[[
.6.1.2 Step XPath Context

When a step evaluates an XPath expression using XPath 1.0, it does so
with the following initial context:

context node
The document node that appears on the primary input port of the step,
unless otherwise specified by the step.

context position and context size
The position and size are both "1", unless otherwise specified by the step.

variable bindings
**** None, unless otherwise specified by the step. ****

]]

Xmlizer

On Tue, Nov 4, 2008 at 4:39 PM, Norman Walsh <ndw@nwalsh.com> wrote:
> mozer <xmlizer@gmail.com> writes:
>
>> hum...this one is not ok either since $opos is not bounded at this place...
>
> It was in the original example:
>
> <p:for-each>
>  <p:variable name="opos" select="p:iteration-position()"/>
>  <p:for-each>
>    <p:iteration-source select="//div"/>
>    <p:string-replace match="/div/@a"
>                      replace="concat($opos,',',p:iteration-position())"/>
>  </p:for-each>
> </p:for-each>
>
>                                        Be seeing you,
>                                          norm
>
> --
> Norman Walsh <ndw@nwalsh.com> | Great men too make mistakes, and many
> http://nwalsh.com/            | among them do it so often that one is
>                              | almost tempted to call them little
>                              | men.-- Lichtenberg
>

Received on Tuesday, 4 November 2008 16:34:52 UTC