Wrox Programmer Forums
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 28th, 2006, 05:23 PM
Registered User
 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default xslt

aaaaa
 
Old December 28th, 2006, 06:57 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Try

http://www.dpawson.co.uk/xsl/sect2/N7450.html

especially the first item.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old December 28th, 2006, 07:01 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Perhaps I answered the wrong question: displaying five items per row of a table is essentially the same problem as displaying five rows per page, except that you presumably want multiple HTML output files. In XSLT 2.0 you can do that with xsl:result-document. In 1.0 there's no standard equivalent, though some products have proprietary extensions; otherwise you need to run the stylesheet N times, once to produce each output page, supplying a parameter to control which page is generated.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old December 30th, 2006, 06:32 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

OK, so you are producing multiple tables within one HTML page, not multiple pages as suggested in your original post. In that case, the problem is exactly the same as outputting multiple items in one row of a table, which is discussed in the FAQ I referred you to. The general solution is along the lines

<xsl:for-each select="object[position() mod $N = 1]">
  <table>
    <xsl:for-each select=". | following-sibling::object[position() &lt;= $N]">
      <tr>
        ....

Or perhaps I've misunderstood the question yet again, and you only want to display the first five items and ignore the rest. In that case the above simplifies to

<table>
  <xsl:for-each select="object[position() &lt;= 5]">
    <tr>
      ....

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating XSLT with XSLT stonis XSLT 3 April 1st, 2008 08:17 PM
General XSLT Questions in the XSLT Forum jminatel BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 0 March 31st, 2008 07:50 PM
Can XSLT read DTD/schema and Generate XSLT.. ROCXY XSLT 1 November 6th, 2006 09:39 AM
dynamic xslt -> xslt creation namespace problem jkmyoung XSLT 2 July 15th, 2006 12:42 AM
xslt with an xslt outputfile alleycat XSLT 4 February 20th, 2006 09:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.