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

Grouping elements in table using xsl:fo

Subject: Grouping elements in table using xsl:fo
From: "James Steven" <JSteven@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Jun 2004 12:15:37 +0100
xsl fo grouping
Hi
I have the following xml:

<x>
	<y>
		<z>
			<A>ff</A>
			<B>gg1</B>
			<C>hh</C>
			<D>ii</D>
			<E>jj</E>
		</z>
	</y>
	<y>
		<z>
			<A>kk</A>
			<B>gg2</B>
			<C>ll</C>
			<D>mm</D>
			<E>nn</E>
		</z>
	</y>
	<y>
		<z>
			<A>tt</A>
			<B>gg3</B>
			<C>uu</C>
			<D>vv</D>
			<E>ww</E>
		</z>
	</y>
	<y>
		<z>
			<A>pp</A>
			<B>gg1</B>
			<C>qq</C>
			<D>rr</D>
			<E>ss</E>
		</z>
	</y>
	<y>
		<z>
			<A>ff</A>
			<B>gg2</B>
			<C>hh</C>
			<D>ii</D>
			<E>jj</E>
		</z>
	</y>
</x>

I would like to create a row for each <z> in a table grouped by the value of
<B>.  For each different value of <B> there would be a heading and on the
rows below each heading each <z> which has the same <B> value.

eg.

				A   C   D   E
                   gg1
				ff  hh  ii  jj
				pp  qq  rr  ss
			 gg2
				kk  ll  mm  nn
				ff  hh  ii  jj
			 gg3
                        tt  uu  vv  ww

So far I have only been able to list all three unique values of <B> in one
row at the start of the table.  To do this I have used:

<fo:table-row>
	<fo:table-cell xsl:use-attribute-sets="x.x.x.x">
		<fo:block xsl:use-attribute-sets="x.x.x.x">
<xsl:apply-templates select="y/z/B[not(. = preceding::B)]"/>
	<xsl:sort select="B"/>
		</fo:block>
	</fo:table-cell>
</fo:table-row>


I have not been able to place each unique value of <B> in a new row and
group each <Z> by <B>.  Also as I am using xsl:fo I have not been using the
Meuchian Method as I am not sure that it is compatible.

Any help would be gratefully received.
Thanks
James Steven







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.