[Bug 29818] [xslt30] Visibility and Applicability of Accumulators

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29818

--- Comment #1 from Michael Kay <mike@saxonica.com> ---
An alternative approach was suggested by Abel during WG discussion: make
accumulator names global and require them to be unique. This isn't as bad as it
sounds, it simply obliges people to use namespaces if they want to avoid a
clash.

However, I can't say I feel entirely comfortable with it, simply because (as
MSpMcQ pointed out) it's a good idea if names of different kinds of object are
all handled in the same way.

Looking back at my proposal, there are really two parts to it:

(a) to drop the requirement that the accumulator named in the argument to
acc-before/acc-after be visible in the package containing the call. I don't
like this use of static name scope for a dynamic name, but we have it all over
the place (e.g. decimal formats and keys) so it's not something that stands out
as inconsistent.

(b) to state that for documents such as those read using doc() or collection(),
or temporary trees created using xsl:variable, the applicable accumulators are
those defined in the "originating package". On reflection, this seems to
require a lot of machinery in the specification and in implementations that we
could do without.

I think the problem that triggered this bug report was the realisation that a
document might have two completely different accumulators with the same name
and that this could be very confusing for users. But again, we allow multiple
functions or variables or keys or decimal formats with the same name. With
keys, we even allow multiple keys with the same name on the same document, so
the analogy between keys and accumulators is very close.

On reflection, therefore, I'm inclined to stick with the status quo.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 6 October 2016 18:34:43 UTC