Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
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 April 30th, 2011, 03:22 AM
Registered User
 
Join Date: Apr 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Hi,

Thanks for your time..

And below is the latest xslt:

<code>
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">


<xsl:template match="/candidates">


<fo:root>

<fo:layout-master-set>
<fo:simple-page-master master-name="my-page" page-width="8in" page-height="11.5in">
<fo:region-body margin-top="0.80in" margin-bottom="0.20in" margin-left="0.20in" margin-right="0.20in" />
</fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="my-page">

<fo:flow flow-name="xsl-region-body">
<fo:block>
<fo:table text-align="center" border-spacing="3pt">

<fo:table-column column-number="1" />
<fo:table-column column-number="2" />


<fo:table-header>
<fo:table-row>
<fo:table-cell number-columns-spanned="2">
</fo:table-cell>
</fo:table-row>
</fo:table-header>

<fo:table-body>


<xsl:apply-templates select="report-bO/candidate-ro-details"/>

</fo:table-body>

</fo:table>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>


<xsl:template match="report-bO/candidate-ro-details">

<fo:table-row>

<fo:table-cell height="5cm" overflow="hidden" number-rows-spanned="2" number-columns-spanned="1">
<fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt" white-space-collapse="false" white-space-treatment="preserve"><xsl:value-of select="attendancenumber"/></fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt" white-space-collapse="false" white-space-treatment="preserve"><xsl:value-of select="roname"/></fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt" white-space-collapse="false" white-space-treatment="preserve"><xsl:value-of select="contactname"/></fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt" white-space-collapse="false" white-space-treatment="preserve"><xsl:value-of select="filecasenumber"/></fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt" ><xsl:value-of select="addressline1"/></fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt" ><xsl:value-of select="addressline2"/></fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt" ><xsl:value-of select="addressline3"/>
<xsl:choose>
<xsl:when test="(string-length(addressline4)&gt;0)">
, <xsl:value-of select="addressline4"/>
</xsl:when>
<xsl:otherwise>
<fo:leader/>
</xsl:otherwise>
</xsl:choose>

</fo:block>
<fo:block text-align="left" margin-left="40pt" font-size="10pt"><xsl:value-of select="addressline5"/>
<xsl:choose>
<xsl:when test="(string-length(addressline6)&gt;0)">
, <xsl:value-of select="addressline6"/>
</xsl:when>
<xsl:otherwise>
<fo:leader/>
</xsl:otherwise>
</xsl:choose>

</fo:block>

<fo:block text-align="left" font-size="20pt"><fo:leader/></fo:block>
</fo:block>
</fo:table-cell>


</fo:table-row>
</xsl:template>
</xsl:stylesheet>

</code>


If you need any more information, please let me know.

Regards
Vishal
 
Old May 2nd, 2011, 08:42 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

I am sorry but this is the same XSLT file you posted, which has a number of FO violations. Which processor are you using? I am testing with FOP 1.0 and get violation. When I get rid of the violations, a only get 5 per page.
 
Old May 3rd, 2011, 04:17 AM
Registered User
 
Join Date: Apr 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Hi ,

Thanks for the reply.

I am using the fop jar "fop-0.20.5".

After eliminating violations did you get 5x2 labels per page starting from 1st page?

Regards
Vishal
 
Old May 3rd, 2011, 08:49 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

No, I get 5 X 1. I am using FOP 1.0
 
Old May 5th, 2011, 05:01 AM
Registered User
 
Join Date: Apr 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Hi ,

Thanks for yor time.

But i am also able to get 5x1 labels per page without blank page , but when 5x2 lables are printing in that case I am getting the first page as blank.

Do i need to change the FOP version?

Please suggest me.

Regards
Vishal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink in PDF not working (XML to PDF using XSL-FO stylesheet) sidh.000 XSLT 0 September 30th, 2010 12:53 PM
XSL Fo: Forcing page numbers ashishb2281 XSLT 0 August 1st, 2008 08:43 AM
how to assign fo:page-number to a xsl:variable or jyotsnag XSLT 0 March 14th, 2006 01:49 AM
xml + xsl:fo --> PDF Kabe Classic ASP XML 0 August 26th, 2004 06:17 AM
Every other page blank in PDF jmurdock BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 July 6th, 2004 12:44 PM





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