[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

grouping problem

Subject: grouping problem
From: tofner@xxxxxxxxxxx
Date: Wed, 28 Nov 2007 02:42:03 +0000
 grouping problem
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.