RE: [xsl] Performance Tuning

Subject: RE: [xsl] Performance Tuning
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 11 Nov 2004 00:05:15 -0000
> 	<xsl:for-each-group select="Document/ParentGroup"
> group-starting-with="ParentGroup">
> 	<xsl:element name="{$priroot}">
> 	<xsl:variable name="priId" select="." />
> 		</xsl:element>
> 	</xsl:for-each-group>

The xsl:variable here is redundant as the variable is never referred to; and
the xsl:element is producing an element that doesn't depend in any way on
the content of the current group.

For an example of how to use group-starting-with, see 

http://www.w3.org/TR/xslt20/#grouping-examples

specifically, the example " Identifying a Group by its Initial Element "

Michael Kay
http://www.saxonica.com/


> 
> 
> I am getting the Parent group description repeated for
> each grop node.
> 
> <Document>
>  <ParentGroup Node1>
>   <PRIMARY_CUST_DESC>Node1+ 1.1.3</PRIMARY_CUST_DESC>
>   <ChildGroup Node1.1 >
> 	<ACCOUNT_SUMMARY>
> 	- <Child Node1>1.1.1 </Child Node1>
> 	- <Child Node2>1.1.2 </Child Node2>
> 	- <Child Node3>1.1.3 </Child Node3>
> 	<ACCOUNT_SUMMARY>
>   </ChildGroup>
>   <PRIMARY_CUST_DESC>Node1+ 1.2.3</PRIMARY_CUST_DESC>
>   <ChildGroup Node1.2 >
> 	<ACCOUNT_SUMMARY>
> 	- <Child Node1>1.2.1 </Child Node1>
> 	- <Child Node2>1.2.2 </Child Node2>
> 	- <Child Node3>1.2.3 </Child Node3>
> 	</ACCOUNT_SUMMARY>
>   </ChildGroup>
>   <PRIMARY_CUST_DESC>Node1+ 1.3.3</PRIMARY_CUST_DESC>
>   <ChildGroup Node1.3 >
> 	<ACCOUNT_SUMMARY>
> 	- <Child Node1>1.3.1 </Child Node1>
> 	- <Child Node2>1.3.2 </Child Node2>
> 	- <Child Node3>1.3.3 </Child Node3>
> 	</ACCOUNT_SUMMARY>
>   </ChildGroup>
>  </ParentGroup>	
>  <ParentGroup Node2>	
>  <PRIMARY_CUST_DESC>Node2+ 2.1.3</PRIMARY_CUST_DESC>
>   <ChildGroup Node2.1 >
> 	<ACCOUNT_SUMMARY>
> 	- <Child Node1>2.1.1 </Child Node1>
> 	- <Child Node2>2.1.2 </Child Node2>
> 	- <Child Node3>2.1.3 </Child Node3>
> 	</ACCOUNT_SUMMARY>
>   </ChildGroup>
>   <PRIMARY_CUST_DESC>Node2+ 2.2.3</PRIMARY_CUST_DESC>
>   <ChildGroup Node2.2 >
> 	<ACCOUNT_SUMMARY>
> 	- <Child Node1>2.2.1 </Child Node1>
> 	- <Child Node2>2.2.2 </Child Node2>
> 	- <Child Node3>2.2.3 </Child Node3>
> 	</ACCOUNT_SUMMARY>
>   </ChildGroup>
>   <PRIMARY_CUST_DESC>Node2+ 2.3.3</PRIMARY_CUST_DESC>
>   <ChildGroup Node2.3 >
> 	<ACCOUNT_SUMMARY>
> 	- <Child Node1>2.3.1 </Child Node1>
> 	- <Child Node2>2.3.2 </Child Node2>
> 	- <Child Node3>2.3.3 </Child Node3>
> 	</ACCOUNT_SUMMARY>
>   </ChildGroup>
>  </ParentGroup>	
> ...........
> </Document>
> 
> Can you please let me know where am I doing wrong.
> 
> Thanks in advance.
> Bhupendra.
> 
> 
> 
> 	
> 	
> 		
> ___________________________________________________________ 
> ALL-NEW Yahoo! Messenger - all new features - even more fun! 
> http://uk.messenger.yahoo.com

Current Thread