XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Sonika ColasoSubject: Limit records to 4 per page. Please help!
Author: Sonika Colaso
Date: 01 Sep 2009 10:42 AM
Originally Posted: 01 Sep 2009 10:41 AM
Hello. I am hoping someone can help me with this. Each record (COLORWAY_NAME) prints as a column on my report. I want to restrict it to 4 columns on a page & start a new page for the next four and so on. I am not sure if its the postition() or the mod or the count function I need to use. PLESE ADVISE on which one and HOW to use it. Appreciate any help. Here is a snippet of the XML & XSL code after it. The for-each statement below doesn't work. In the XML below, I want a new page starting for GREEN (after 4 colors). THANKS!

<!-- XML SNIPPET -->

<colorways color_no = "6" colorway_name = "FIELD KHAKI" status = "Y"> </colorways>
<colorways color_no = "12" colorway_name = "CERAMIC GREY" status = "Y"> </colorways>
<colorways color_no = "3" colorway_name = "BLUE" status = "Y"> </colorways>
<colorways color_no = "5" colorway_name = "RED" status = "Y"> </colorways>
<colorways color_no = "7" colorway_name = "GREEN" status = "Y"> </colorways>


<!-- XSL SNIPPET -->

<!--DEFINE PAGE -->

<fo:simple-page-master margin-right="0.5in" margin-left="0.5in" margin-bottom="0.25in" margin-top="0.25in" page-width="11.0in" page-height="8.5in" master-name="standard3">
<fo:region-before extent="0.5in"/>
<fo:region-body margin-top="0.5in" margin-bottom="0.25in"/>
<fo:region-after extent="0.25in"/>
</fo:simple-page-master>

<!-- REPEAT PAGE for > 4 Colorways -->

<xsl:for-each select="//colorways/count(@colorway_name)>3]">
<fo:page-sequence master-reference="standard3">
<fo:static-content flow-name="xsl-region-before">
<fo:table table-layout="fixed">
.
.
.
.
</xsl:for-each>

Postnext
Alberto MassariSubject: Limit records to 4 per page. Please help!
Author: Alberto Massari
Date: 02 Sep 2009 12:43 PM
Hi Sonika,
you should write

<xsl:for-each select="//colorways">

and then add a

<xsl:if test="position() mod 4 = 0">
<fo:block break-after='page'/>
</xsl:if>

Alberto

Postnext
Sonika ColasoSubject: Limit records to 4 per page. Please help!
Author: Sonika Colaso
Date: 08 Sep 2009 10:25 AM
Thanks Alberto! I'm struggling with where in my code can I add yours. Can't seem to get it to work. Will uploading my entire XSL help? Thanks again!

Posttop
Sonika ColasoSubject: Limit records to 4 per page. Please help!
Author: Sonika Colaso
Date: 08 Sep 2009 10:35 AM
Thanks Alberto! I'm struggling with where in my code can I add yours. Can't seem to get it to work. Will uploading my entire XSL help? Thanks again!

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.