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

RE: Working through a sorted nodeset 3 at a time

Subject: RE: Working through a sorted nodeset 3 at a time
From: Pieter Reint Siegers Kort <pieter.siegers@xxxxxxxxxxx>
Date: Fri, 9 Jul 2004 19:58:56 -0500
sorted nodeset
Hi,

You have an incorrect expression in the select attribute of:

<xsl:apply-templates select="current()[position() mode 3 = 1"
mode="hits_page" /> 

--> '[position() mode 3 = 1' 
                    ^      ^
                    |      |

could be '[position() mod 3]'

But not '[position() mod 3 = 1]' not, as this would return a true or false
and would normally be used in a xsl:if test.

If your expression works correctly after having corrected it, I can't tell
because I don't know what the input XML is like.

Anyway, I hope this helps :-)

Cheers,
<prs/>

-----Original Message-----
From: lsl@xxxxxxxxxxxxx [mailto:lsl@xxxxxxxxxxxxx] 
Sent: Friday, July 09, 2004 5:36 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Working through a sorted nodeset 3 at a time

Hi,
 
I have some XSLT that looks like :

   <xsl:apply-templates select="DATA/ROWS/ROW" mode="sorted_list">
      <xsl:sort select="FIELD[@ID='1']/VALUE" order="ascending" />
    </xsl:apply-templates>

    <xsl:template match="ROW" mode="sorted_list">
        <xsl:apply-templates select="current()[position() mode 3 = 1" 
mode="hits_page" />
    </xsl:template>

    <xsl:template match="ROW" mode="hits_page">
        hits_page : <xsl:value-of select="." />
    </xsl:template>

I don't get anything output by the hits_page template.  I don't think using
'current()' is correct here, I've tried ".[position() ......]" (and a few
others) but this gives me 'invalid XPath expression'.

Hopefully there's just a bit of syntax I don't know about.

Thanks

Steve

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.