Re: QT4CG-003-02: MK to propose a reformulation of fn:index-of() in terms of fn:index-where()

> In the old joint WG, some XSL-WG members objected to such expositions
relying exclusively on XQuery syntax,
> and insisted on an equivalent being provided in XSLT.
> I don't feel any strong need to continue that tradition.

We can still have a win -- win result if the code is specified in pure
XPath. In this case this is both XQuery and XSLT, and we provide only a
single code snippet.

So, let us try to provide the code implementation in XPath.

Thanks,
Dimitre

On Wed, Sep 21, 2022 at 12:25 AM Michael Kay <mike@saxonica.com> wrote:

> >
> >> But it might be better to formulate index-where as
> >>
> >> for $item at $position in $input
> >> where $predicate($item)
> >> return $position
> >
> > That seems clear to me. Is the suggestion that it should be normatively
> > described this way, or only that this should be shown as an illustration
> > of its semantics?
> >
>
> I personally like the approach of giving the rules in readable English
> prose, and then adding the phrase "More formally, the function returns the
> value of {some expression}."
>
> With this formulation, both the prose and the expression are normative,
> but it should be clear to the reader that the "more formally" exposition
> can be relied on to resolve any ambiguities in the prose.
>
> In the old joint WG, some XSL-WG members objected to such expositions
> relying exclusively on XQuery syntax, and insisted on an equivalent being
> provided in XSLT. I don't feel any strong need to continue that tradition.
>
> Michael Kay
>
>
>

Received on Wednesday, 21 September 2022 14:12:02 UTC