xsl-list
[Top] [All Lists]

[xsl] grouping problem

2007-11-27 19:42:36
I could use some hints on using for-each group in 2.0 using Saxon8. I am sure 
that the problem is my stylesheet. Here is the input:

<selection name="u1pt01"> 
        <para> text . . . </para>
</selection>
<selection name="u1pt02"> 
        <para> text . . . </para>
</selection>
etc.

<item id="1" selection="u1pt01">
        <text> text and more tags</text>
</item>
<item id="2" selection="u1pt01">
        <text> text and more tags</text>
</item>
<item id="3" selection="u1pt02">
        <text> text and more tags</text>
</item>
etc.

I am trying to group the name attribute of the <selection> elements with 
matching <item> selection attributes so that the <items> follow their 
<selection> elements.

In my experiments using Saxon8, the following transformation only strips 
out all <selection> items. I put in the <story> tag just to see if 
the for-each-group is working.

<xsl:template match="selection">
   <xsl:for-each-group select="*" 
                       group-by="@name">
     <xsl:sort select="current-grouping-key()"/>
<story>
        <xsl:copy-of select="."/>
</story>
</xsl:for-each-group>
</xsl:template>

Thanks in advance for any hints,

Terry

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>