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

Re: AW: Special processing for the first process of an

Subject: Re: AW: Special processing for the first process of an element
From: Geert Josten <Geert.Josten@xxxxxxxxxxx>
Date: Thu, 11 Nov 2004 23:52:22 +0100
preceding axis slow
Peter Hickman wrote:

<xsl:template match="result">
<xsl:choose>
<xsl:when test="preceding::result">
<result class="rest"><xsl:apply-templates select="*|text()" /></result>
</xsl:when>
<xsl:otherwise>
<result class="first"><xsl:apply-templates select="*|text()" /></result>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

If using the preceding axis is getting slow on large XML documents, you could switch to keys.


(top-level)
<xsl:key name="results" match="result" use="'all'" />

(result template)
<xsl:when test="generate-id(.) = generate-id(key('results', 'all')[1])">
   ... first ...
</xsl:when>

Cheers,
Geert

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.