Presumably you mean you want to know if the current item matches the group-starting-with pattern? As in
 
<xsl:for-each-group select="*" group-starting-with="H2">
  <xsl:if test="self::H2">...
 
I tend to use the above style (repeating the test) if it's a simple pattern, or I might use
 
<xsl:if test="position()=1">...
 
They're not quite the same thing, of course, in that the first item in the 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.
 
Michael Kay
http://www.saxonica.com/


From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of Paulo F. Sarli
Sent: 21 June 2006 18:47
To: saxon-help@lists.sourceforge.net
Subject: [saxon] current-group-matches() function

I have used the <xsl:for-each-group> element quite a lot. One feature that I miss is a function that would allow me to know if the current group matches the group-starting-with or group-ending-with criteria without having to repeat the test on the nodes in the current group (all over again). The main reason would be to cut back on verbosity... I guess there might exist an easy work-around that somebody might know of, so please forgive my ignorance. A true() or a false() is all that would be needed as the result for this function

Paulo F. Sarli
--
A coisa certa dita na hora errada
pior do que
a coisa errada dita na hora certa...