[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] how to sort after applying generate-id()?


Subject: Re: [xsl] how to sort after applying generate-id()?
From: Mukul Gandhi <mukulgw3@xxxxxxxxx>
Date: Tue, 14 Oct 2003 18:23:55 -0700 (PDT)

I feel, it should be possible with xsl:sort .. Its
difficult to understand where xsl:for-each starts in
the XSL, and for what purpose you are using
generate-id .. It *seems you want to do Muenchian
grouping *.. 

If you can clarify the problem more -- 
the XML structure(at least provide 2,3 more <ENTITY>
tags), 

complete the missing parts of XSL(I cannot see the
attribute TOTAL_FUND_VALUE_NET, which you have
mentioned in XSL), 

how you want the grouping to be done, and 

the desired output .. somebody can give suggestion..

Regards,
Mukul

--- "Lee, Insoo" <Insoo.Lee@xxxxxx> wrote:
> 
> Hello - 
>  I'm having trouble sorting the item grouped by
> generate-id()...
> 
> 
> I have xml that looks like
> 
> <REPORT>
>  <ENTITY>
> 	 <FUND_CURRENCY_GROUP CURRENCY="GBP">
> 		 <FUND_CODE_GROUP TA_FUND_CODE="G631">
> 			 <FUND_ROW>
> 				  <TRADE_TYPE>PUR</TRADE_TYPE> 
> 			  </FUND_ROW>
> 		  </FUND_CODE_GROUP>
> 	  </FUND_CURRENCY_GROUP>
> 	  <FUND_CURRENCY_GROUP CURRENCY="USD">
> 		 <FUND_CODE_GROUP TA_FUND_CODE="U631">
> 			 <FUND_ROW>
> 				  <TRADE_TYPE>PUR</TRADE_TYPE> 
> 			  </FUND_ROW>
> 		  </FUND_CODE_GROUP>
> 	  </FUND_CURRENCY_GROUP>
>  </ENTITY>
>   
>   and many more ENTITY like this
>   </REPORT>
> 
> 
> XSL looks like follwing:
> 
> 	        <xsl:variable name="currencies"
> select="//FUND_CURRENCY_GROUP"/>
> 
>                         <xsl:if
> test="generate-id(.)=
>                             generate-id(
> $currencies[ @CURRENCY =
>                                        
> current()/@CURRENCY ] )">
> 
> 
>                         <tr>
>                             <td colspan="4"><b>Grand
> Total Purchases
> (<xsl:value-of select="@CURRENCY"/>):</b></td>
>                             <td align="right"
> width="14%"> </td>
>                             <td align="right"
> width="14%"> </td>
>                          </tr>
> 
>                         <tr>
>                             <td colspan="4"><b>Grand
> Total Redemptions
> (<xsl:value-of select="@CURRENCY"/>):</b></td>
>                             <td align="right"
> width="14%"> </td>
>                             <td align="right"
> width="14%"> </td>
>                         </tr>
> 
>                         <tr>
>                             <td colspan="4"><b>Grand
> Total Net Change
> (<xsl:value-of select="@CURRENCY"/>):</b></td>
>                             <td align="right"
> width="14%"> </td>
>                             <td align="right"
> width="14%"> </td>
>                             <!-- I would do
> something like this, if it works
> <td align="right" width="14%"><b><u><xsl:value-of
> select="format-number(sum(
>
$currencies[@CURRENCY=current()/@CURRENCY]/FUND_CODE_GROUP/@TOTAL_FUND_VALUE
> _NET ), '#,###,###,##0.00')"/></u></b></td> -->
>                         </tr>
>                             </xsl:if>
>                         </xsl:for-each>
> 
> 
> 	This would return me cross-entities grouped by
> currency
> 
> 	Grand Total Purchases (USD)
> 	Grand Total Purchases (GBP)
> 	Grand Total Purchases (EUR)
> 
> 	This is good, but is there anyway to combine
> sorting with this
> generate-id() so that it appears alphabetically?
> 
> 	Grand Total Purchases (EUR)
> 	Grand Total Purchases (GBP)
> 	Grand Total Purchases (USD)
> 
>  Thanks
>  IL
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



Current Thread
Keywords