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

Re: Grouping data at multiple levels (can XSL do this?

Subject: Re: Grouping data at multiple levels (can XSL do this?)
From: Hank Ratzesberger <hankr@xxxxxxxx>
Date: Tue, 28 Jun 2011 21:05:33 -0700
Re:  Grouping data at multiple levels (can XSL do this?
Hi Senthil,

Something like this perhaps, selecting the TAB_ITEMs
that have a ZZBKITEM child with a certain value:

<TAB_ITEM>
<xsl:for-each select="/TAB_ITEM[ZZBKITEM='TYPE1]">
<xsl:copy-of select="."/>
</xsl:for-each>
</TAB_ITEM>

Or maybe copy-of can do all the work:

<OTHER_ITEMS>
<xsl:copy-of select="/TAB_ITEM[ZZBKITEM='TYPE2'"/>
</OTHER_ITEMS>

If you use xsl:for-each-group, the content will be sorted into
the same categories, but you would have to perform the
same select/test again to determine what is actually in the
current-group().

Best,
Hank

On 06/28/2011 06:33 PM, Senthilukvelaan wrote:
Hi All,
I have posted the similar question in the past.   I am also trying to
do something similar in xslt multi-level grouping based
on the value of a node.
<TAB_ITEM>
<ZZBKITEM>TYPE1</ZZBKITEM>
<QTY>1</QTY>
<PRICE>99.00</PRICE>
<EXT_PRICE>99.00</EXT_PRICE>
<ZZBKSUBITEM/>
</TAB_ITEM>
<TAB_ITEM>
<ZZBKITEM>TYPE1</ZZBKITEM>
<QTY>1</QTY>
<PRICE>99.00</PRICE>
<EXT_PRICE>99.00</EXT_PRICE>
<ZZBKSUBITEM/>
</TAB_ITEM>
<TAB_ITEM>
<ZZBKITEM>TYPE2</ZZBKITEM>
<QTY>1</QTY>
<PRICE>99.00</PRICE>
<EXT_PRICE>99.00</EXT_PRICE>
<ZZBKSUBITEM/>
</TAB_ITEM>

Expected output:

<TAB_ITEMS>
<TAB_ITEM>
<BKITEM>TYPE1</BKITEM>
<QTY>1</QTY>
<PRICE>99.00</PRICE>
<EXT_PRICE>99.00</EXT_PRICE>
</TAB_ITEM>
<TAB_ITEM>
<BKITEM>TYPE1</BKITEM>
<QTY>1</QTY>
<PRICE>99.00</PRICE>
<EXT_PRICE>99.00</EXT_PRICE>
</TAB_ITEM>
<TAB_ITEMS>

<OTHER_ITEMS>
<TAB_ITEM>
<BKITEM>TYPE2</BKITEM>
<QTY>1</QTY>
<PRICE>99.00</PRICE>
<EXT_PRICE>99.00</EXT_PRICE>
</TAB_ITEM>
<OTHER_ITEMS>

Please help me, how I do split into two different groups.


Thanks Senthil

-- Louis (Hank) Ratzesberger sopac.ucsd.edu

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