Subject: Re: [xsl] Grouping data at multiple levels (can XSL do this?) From: Hank Ratzesberger <hankr@xxxxxxxx> Date: Tue, 28 Jun 2011 21:05:33 -0700 |
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>
<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
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Grouping data at multiple, Senthilukvelaan | Thread | [xsl] xmlns="" added to output, Thomas, Jackie R Jr |
Re: [xsl] Grouping data at multiple, Senthilukvelaan | Date | Re: [xsl] How to pass an XPath as a, Hank Ratzesberger |
Month |