[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] current() within a key element's @use


Subject: Re: [xsl] current() within a key element's @use
From: Chris Maloney <voldrani@xxxxxxxxx>
Date: Fri, 28 Dec 2012 14:57:34 -0500

Dimitre wrote:

> There is a "slight" difference: I didn't use key() inside the
> expression in the "use"  attribute ....

That's why I used the word "variant".  I referred to your answer on SO
to provide context for the code snippet.

Martin Honnen <Martin.Honnen@xxxxxx> wrote:
>
> Saxon (6.5?) is right to complain as the errata E13
> (http://www.w3.org/1999/11/REC-xslt-19991116-errata/) to the XSLT 1.0 spec
> says "It is an error for the value of either the use attribute or the match
> attribute to contain a VariableReference, or a call to the key function.".
>

Nevertheless, this might be a useful work-around.  It was established
that xsltproc has a bug, and so the fact that xsltproc doesn't choke
on this non-standards-conforming expression doesn't really matter.
The original poster asked, "If this is a bug, is there a workaround?",
and I was trying to answer that question.

It seems odd to me that key-within-a-key isn't allowed.  If it's just
to prevent infinite recursion, as Dimitre suggested, then that seems a
little paternalistic:  other languages have no problem allowing coders
to shoot themselves in the foot that way.

Cheers!
Chris


Current Thread
Keywords