Thanks. As I say, it's hard to argue that the function
wouldn't occasionally be useful. But it's not going to get added to the W3C spec
at this stage in the process. And my experience with vendor extension functions
is that it's not worth introducing an extension function without a very strong
justification - most users prefer to avoid extension functions, and those that
don't sometimes regret it when they want to make their code
I´ve found out, the hard way, that
current-group-key() works only for group-by and group-adjacent, not for
group-starting-with and group-ending-with.
right on target, that´s exactly what I meant. Why do I long for such a
1) I tend to use rather complex grouping patterns, and
oftentimes I nest "group-ending-with" within "group-starting-with" constructs,
so this would help me cut down the verbosity and consequently programming
errors as well
2) I have the impression (might be wrong of course) that
such a function would make my stylesheets run faster, in my case maybe a lot
faster due to reason in item 1 (above)
3) I gather that this "status or
information" about the current group is already available as the groups are
being built, so, why not make it into a function, available in the stylesheet
4) Grouping within XSLT seems to be such a complete solution,
with so many facilities and even niceties, that I just can´t help but feel
that this function should be there already, it sure does seems logical to me.
Take for instance, the current-grouping-key() function mentioned by Andrew
(first part of this reply). When you "group-by" or "group-adjacent" the
current-grouping-key() function just begs to exist. When you
"group-starting-with" and "group-ending-with", since you already know what the
"grouping-key" is, the function that begs to exist is a function that tells me
if the current-group matches (or not) the grouping criteria.
IMHO, those are good enough arguments. I do appreciate, of course, your
insights, so I´m looking forward to your reply...
On 6/22/06, andrew
6/22/06, Michael Kay <email@example.com>
> Presumably you mean you want to know if the
current item matches the
> group-starting-with pattern? As in
> <xsl:for-each-group select="*"
> I tend to use the above style
(repeating the test) if it's a simple pattern,
> or I might
> <xsl:if test="position()=1">...
They're not quite the same thing, of course, in that the first item in
> first group doesn't necessarily match the pattern.
> I'd say my view on this is: you have a point, but it would
need a strong
> argument to justify adding an extra function to the
spec or an extension
> function to Saxon.
current-grouping-key() return in this case? I would've
thought you could do something like:
...if current-grouping-key() magically
returned a node in this case.
Just a thought.
advantages of Linux Managed Hosting--Without the Cost and Risk!
trained technicians. The highest number of Red Hat certifications in
hosting industry. Fanatical Support. Click to learn more
A coisa certa dita na hora errada
é pior do que
coisa errada dita na hora certa...