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

RE: Using xsl:sort causes transformer to fail

Subject: RE: Using xsl:sort causes transformer to fail
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 20 Jan 2007 17:01:01 -0000
RE:  Using xsl:sort causes transformer to fail
1. What do you mean when you say it "fails" or "doesn't work"? What are the
symptoms?

2. What does the source XML look like?

3. It looks a very strange sort key, what are you trying to achieve?

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


> -----Original Message-----
> From: Sola Awe [mailto:sodana@xxxxxxxxxxx] 
> Sent: 20 January 2007 15:29
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Using xsl:sort causes transformer to fail
> 
> Hi,
>   I have an xsl:sort expression that doesn't always work all 
> the time.  Not sure why.  Here is a segment of my code:
> 
> ------------------------
> xsl:for-each select="$group/ITEM">
>   <xsl:sort 
> select="*[name()=$group/ITEM/*[name()=$rowKey]]/@*[name() = 
> $sortBy]" order="{$sortOrder}" data-type="number"/>
> 
>   <xsl:if test="*[name()=$group/ITEM/*[name()=$rowKey]]">
>     <xsl:call-template name="processItem">
> 	<xsl:with-param name="columnNode"	select="$columnNode"/>
> 	<xsl:with-param name="dataGroup"	select="$group"/>
> 	<xsl:with-param name="rowKey"		
> select="*[name()=$rowKey]"/>
> 	<xsl:with-param name="repeatName" 	
> select="attribute::SORTNAME"/>	        
> </xsl:call-template>
>   </xsl:if>
> </xsl:for-each>
> 
> ----------------------------------
> This is the code that is failing:
>   <xsl:sort 
> select="*[name()=$group/ITEM/*[name()=$rowKey]]/@*[name() = 
> $sortBy]" order="{$sortOrder}" data-type="number"/>
> 
> if, I remove the following from the xsl:sort,
> 
> *[name()=$group/ITEM/*[name()=$rowKey]]/
> 
> The xsl transformation works fine.  However, I need the code 
> above for the sort to work.
> 
> Any suggestions?
> Thanks.

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.