W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > June 2007

Re: position() after match in component

From: Jeni Tennison <jeni@jenitennison.com>
Date: Thu, 07 Jun 2007 21:22:48 +0100
Message-ID: <46686918.1040504@jenitennison.com>
To: public-xml-processing-model-wg@w3.org

Norman Walsh wrote:
> / Richard Tobin <richard@inf.ed.ac.uk> was heard to say:
> |> However, we want to be able to stream many of our microsteps. On that
> |> basis, I'd be in favor of saying that the context position and context
> |> size are both 1 when the replace expression is evaluated in
> |> p:string-replace (and in analagous situations on other steps).
> |
> | Unless the replace expression is prohibited from accesssing arbitrary
> | nodes, I don't see much advantage to this.  You have to analyse the
> | expression to see if it needs the rest of the document, so you might
> | as well check for calls to position() and size() too.
> |
> |> Both require an unbounded amount of look ahead.
> |
> | As does replace="following-sibling::b"
> Hmm. True. But I think I still prefer position()=last()=1.

Unsurprisingly, I agree with Richard that you may as well give 
position() and last() meaningful values given that you can't guarantee 
streamability anyway. I can quite imagine someone doing:

     <p:option name="match" value="@id" />
     <p:option name="replace" value="concat('id', position())" />

I'd expect the position to be the position amongst all matched nodes.

Jeni Tennison
Received on Thursday, 7 June 2007 20:22:52 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:32:43 UTC