View Single Post
  #4 (permalink)  
Old April 27th, 2011, 10:47 AM
bonekrusher bonekrusher is offline
Friend of Wrox
Points: 1,676, Level: 16
Points: 1,676, Level: 16 Points: 1,676, Level: 16 Points: 1,676, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: , , .
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Hi,

You have 2 issues. First, you tell the FO processor to span rows, but the count doesnt match up. You tell the processor to span each row by 2, but the next row says the same thing. Also, each cell must have a block element.

I made some corrections:

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:block/>
                                    </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" number-columns-spanned="2">
                <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>
Reply With Quote