W3C home > Mailing lists > Public > public-xml-processing-model-comments@w3.org > October 2008

Re: split-sequence: position() and last()

From: mozer <xmlizer@gmail.com>
Date: Fri, 17 Oct 2008 01:10:59 +0200
Message-ID: <21d9ade60810161610if1b819u684a4f3ddb916185@mail.gmail.com>
To: "Norman Walsh" <ndw@nwalsh.com>
Cc: public-xml-processing-model-comments@w3.org

Hum...

The spec says

[[
The XPath context for the test option changes over time. For each
document that appears on the source port, the expression is evaluated
with that document as the context document. The context position
(position()) is the position of that document within the sequence and
the context size (last()) is the total number of documents in the
sequence.
]]

So I can't see why
 <p:split-sequence name="head" test="position() = 1"/>
and  <p:split-sequence name="tail" test="position()=last()"/>
wouldn't work

Xmlizer


On Thu, Oct 16, 2008 at 10:58 PM, Norman Walsh <ndw@nwalsh.com> wrote:
> Ages ago, before we adopted p:iteration-position() and
> p:iteration-size(), we thought that we'd overload the standard
> position() and last() functions for that purpose.
>
> In that world, it was possible to imagine that you could get
> "head" and "tail" from split-sequence:
>
>  <p:split-sequence name="head" test="position() = 1"/>
>
> and
>
>  <p:split-sequence name="tail" test="position()=last()"/>
>
> That's not true anymore. And you can't use iteration position and size
> here.
>
> So there's no efficient way to get the head or tail of a sequence.
>
> Bleh.
>
> I fear we should fix that.
>
>                                        Be seeing you,
>                                          norm
>
> --
> Norman Walsh <ndw@nwalsh.com> | It is a paradoxical but profoundly true
> http://nwalsh.com/            | and important principle of life that
>                              | the most likely way to reach a goal is
>                              | to be aiming not at that goal itself
>                              | but at some more ambitious goal beyond
>                              | it.--Arnold Toynbee
>
Received on Thursday, 16 October 2008 23:11:40 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:28:25 UTC