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

Problem with grouping

Subject: Problem with grouping
From: "Bjorn Boxstart" <boxstart@xxxxxxxx>
Date: Wed, 13 Mar 2002 09:21:22 +0100
stylus 870
Hello all,

I have a problem with the use of the meunchian method for grouping.
The problem is that, within the items that I want to group can belong
to more than one group and I also want them to be listed in all valid
groups. The stylesheet that I have now lists each item in only one
group.

The XML structure of my items is:

<inks>
	<ink>
		<type>type 1</type>
		<applicability>
			<item model="epson stylus 870"/>
			<item model="epson stylus 880"/>
		</applicability>
	</ink>
	<ink>
		<type>type 2</type>
		<applicability>
			<item model="epson stylus 850"/>
			<item model="epson stylus 880"/>
		</applicability>
	</ink>
	<ink>
		<type>type 3</type>
		<applicability>
			<item model="HP 720C"/>
		</applicability>

	</ink>
</inks>

The result should be something like:

Epson stylus 850
	- type 2
Epson stylus 870
	- type 1
	- type 2
Epson stylus 880
	- type 2
HP 720C
	- type 3

I tried to do this with the muenchian method, but when a <ink> element
had applicablility settings for two categories, it was only listed in
one.
Please find a part of the XSLT code below.

	<xsl:key name="applicability" match="ink"
use="applicability/item/@model" />
	<xsl:template match="inks">
			<xsl:for-each select="ink[generate-id()
=generate-id(key('applicability', applicability/item/@model)[1])]">
			<xsl:sort select="applicability/item/@model" />
			<h1><xsl:value-of select="applicability/item/@model" /></h1>
			<xsl:for-each select="key('applicability',
applicability/item/@model)">
				<xsl:sort select="type" />
				<div><xsl:apply-templates select="type"/></div>
			</xsl:for-each>
		</xsl:for-each> -->
	</xsl:template>

If anybody has a suggestion, please don't hesitate to answer this
email ;-)

Regards,

Bjorn


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

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-2013 All Rights Reserved.