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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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
(Deleted User) Subject: Limit records to 4 per page. Please help!
Author: (Deleted User)
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!

   
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.