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

Re: nested grouping problem

Subject: Re: nested grouping problem
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 04 Oct 2010 19:39:04 +0100
Re:  nested grouping problem
On 04/10/2010 18:48, Terry Ofner wrote:
I am mystified as to how the<xsl:if test="position()!=1">;</xsl:if>
knows to put the semicolon after every grouped @main item except the
last one.

it doesn't:-)


it puts a semicolon _in front_ of every item except the first.

Incidentally I think I saw somewhere Michael commenting that for long sequences

<xsl:for-each select=....>
<xsl:if test=position()!=1>,</xsl:if>
<foo/>
</xsl:for-each>

is more efficient (or at least more easily streamed, or something) than the otherwise equivalent


<xsl:for-each select=....> <foo/> <xsl:if test=position()!=last()>,</xsl:if> </xsl:for-each>


as in the first case you can start outputting straight away but the last case you need either to delay until you know last() (ie the length of the sequence) or you have an optimiser smart enough to know you don't really need to know the value of last() just that ther eis another one coming up....



David


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