| Subject: RE: [xsl] Problems grouping adjacent siblings From: "Michael Kay" <mike@xxxxxxxxxxxx> Date: Thu, 30 Jun 2005 18:01:27 +0100 | 
> I would like to group adjacent siblings which share the same 
> local-name
> into a container element.
> 
> I thought that this would be the classical use-case for an
> <xsl:for-each-group> with @group-adjacent, but I am getting the
> strangest results...
I can't tell what you are doing wrong without seeing your code.
With ax as the context node, you can do
<xsl:for-each-group select="*" group-adjacent="local-name()">
  <xsl:choose>
    <xsl:when test="current-grouping-key()='ex'">
      <remark><xsl:copy-of select="current-group()"/></remark>
    </
    <xsl:otherwise>
      <xsl:copy-of select="current-group()"/>
    </
  </
</
Michael Kay
http://www.saxonica.com/ 
| Current Thread | 
|---|
| 
 | 
| <- Previous | Index | Next -> | 
|---|---|---|
| Re: [xsl] Problems grouping adjacen, David Carlisle | Thread | AW: [xsl] Problems grouping adjacen, Huditsch Roman | 
| Re: [xsl] an elements schema contex, Arian Hojat | Date | RE: [xsl] XSLT2/XPath2 books, Michael Kay | 
| Month |