- From: mozer <xmlizer@gmail.com>
- Date: Wed, 5 Nov 2008 12:47:52 +0100
- To: "Henry S. Thompson" <ht@inf.ed.ac.uk>
- Cc: "Norman Walsh" <ndw@nwalsh.com>, public-xml-processing-model-comments@w3.org
Henry,
And what about this case
<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>
Xmlizer
On Wed, Nov 5, 2008 at 12:43 PM, Henry S. Thompson <ht@inf.ed.ac.uk> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> mozer writes:
>
>> It is not clear to me that from *inside* the p:string-replace, the
>> XPath evaluation can see the $opos variable
>> . . .
>> [[[. . . When a _step_ evaluates an XPath expression . . .]]]
>
> Emphasis added
>
>> . . .
>>> <p:string-replace match="/div/@a"
>>> replace="concat($opos,',',p:iteration-position())"/>
>
> But $opos is not being evaluated by the step. That was the whole
> problem with the original example. The 'concat...' XPath expression
> is being evaluated by the XProc processor itself, to _construct_ the
> expression (in this case, "1,1") which the step will evaluate. The
> _processor_ can see the binding of opos just fine.
>
> ht
> - --
> Henry S. Thompson, School of Informatics, University of Edinburgh
> Half-time member of W3C Team
> 10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
> Fax: (44) 131 651-1426, e-mail: ht@inf.ed.ac.uk
> URL: http://www.ltg.ed.ac.uk/~ht/
> [mail really from me _always_ has this .sig -- mail without it is forged spam]
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.6 (GNU/Linux)
>
> iD8DBQFJEYb/kjnJixAXWBoRAg6YAJ9+Rt88Q2QkOYX0PRoioQCIwUQAFwCfQ1Wy
> Yi+oXGqsuBFQTDxlgtPOYPw=
> =78Qj
> -----END PGP SIGNATURE-----
>
Received on Wednesday, 5 November 2008 12:12:25 UTC