[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] mod position() tests positive all of the time
I am new to the list, but I have checked the archive for this particular problem and I haven't been able to find a solution to this. I am using the following stylesheet and everytime it tests for position, the results always print the <tr> (rather than printing every 5th element). Since I am new to XSLT, I know it is probably in the code. Any help would be a lesson. Allen Jones <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" encoding="iso-8859-1"/> <xsl:template match="/"> <html> <body > <xsl:call-template name="results"/> </body> </html> </xsl:template> <xsl:template name="results"> <table> <xsl:for-each select="insightResponse/searchResponse/collectionResultSet/object/thumbnail[position() mod 5 = 1]"> <tr> <xsl:apply-templates select=". | following-sibling::thumbnail[position() < 5]" /> </tr> </xsl:for-each> </table> </xsl:template> <xsl:template match="thumbnail"> <td align="center"><img src="{@URL}" /><br /> <xsl:for-each select="label"><xsl:value-of select="."/><br /></xsl:for-each> </td> </xsl:template> </xsl:stylesheet> Allen Jones Director - Digital Library Programs University Library - New School 55 West13th Street, room 905 New York, NY 10011 (voice) 212.229.5309 x4502 (fax) 212.675.7361
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|