I constructed my first xsl document to render a pdf  using a single template. This worked fine. However the form was rather large so I decided to split certain parts of it into separate templates and now I am getting a null error. Please help

I used fop -xml TIPS.xml -xsl TIPS.xsl -pdf TIPS.pdf

and get

C:\dev\homelet2002\dist\lib>java -cp c:\fop-0.20.1\build\fop.jar;c:\fop-0.20.1\lib\batik.jar;c:\fop-0.20.1\lib\xalan.jar;c:\fop-0.20.1\l
ib\xerces.jar;c:\fop-0.20.1\lib\jimi-1.0.jar org.apache.fop.apps.Fop -xml TIPS.xml -xsl TIPS.xsl -pdf TIPS.pdf
FOP 0.20.1
ERROR: null


xml:

<?xml version="1.0"?>
<TIPS>
        <Details text="Your Details">
                <Text>Please print clearly. State Mr/Mrs/Miss/Ms/Other</Text>
                <Proposer text="Proposer"/>
                <CoverText>Your insurance covers you, your partner and all members of your/their family permanently living in your home. Tenants sharing a property should complete separate applications.</CoverText>
                <Address text="Address">
                        <Street/>
                        <City/>
                        <County/>
                        <PostCode text="Post Code"/>
                </Address>
                <HomePhone text="Tel (Home) "/>
                <WorkPhone text="Tel (Work) "/>
        </Details>
        <Policy>
                <Duration>Do you require a 6 month policy</Duration>
etc etc

xsl:

<?xml version="1.0"?>
<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="/">
                        <xsl:apply-templates match="TIPS" />
        </xsl:template>
        <xsl:template match="TIPS">
                <xsl:processing-instruction name="cocoon-format">type="text/xslfo"</xsl:processing-instruction>
                <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
                        <fo:layout-master-set>
                                <fo:simple-page-master page-master-name="main" margin-top="5pt" margin-bottom="5pt" margin-left="10pt" margin-right="5pt">
                                        <fo:region-body margin-bottom="5pt" column-count="2" column-gap="15pt"/>
                                </fo:simple-page-master>
                        </fo:layout-master-set>
                        <fo:page-sequence>
                                <fo:flow>
                                        <xsl:apply-templates select="Details"/>
                                        <xsl:apply-templates select="Policy"/>
                                        <xsl:apply-templates select="Contents"/>
                                        <xsl:apply-templates select="Possessions"/>
                                        <xsl:apply-templates select="PedalCycle"/>
                                        <xsl:apply-templates select="PremiumTax"/>
                                        <xsl:apply-templates select="TotalMonthlyPrem"/>
                                        <xsl:apply-templates select="Payment"/>
                                        <xsl:apply-templates select="Questions"/>
                                        <xsl:apply-templates select="Disclosure"/>
                                        <xsl:apply-templates select="Declaration"/>
                                        <xsl:apply-templates select="CommenceCover"/>
                                        <xsl:apply-templates select="Signature"/>
                                        <xsl:apply-templates select="Additional"/>
                                        <xsl:apply-templates select="SpecialPossessions"/>
                                        <xsl:apply-templates select="Cycle"/>
                                        <xsl:apply-templates select="Footer"/>
                                        <xsl:apply-templates select="DirectDebit"/>
                                        <xsl:apply-templates select="CreditCard"/>
                                </fo:flow>
                        </fo:page-sequence>
                </fo:root>
        </xsl:template>
        <xsl:template match="Details">
                <fo:table space-before.optimum="10pt">
                        <fo:table-column column-width="270pt"/>
                        <fo:table-body>
                                <fo:table-row>
                                        <fo:table-cell background-color="blue" text-align="center" color="white" font-weight="bold" font-size="12pt" font-family="sans-serif" line-height="18pt" space-after.optimum="3pt" padding-top="2pt" padding-left="2pt">
                                                <fo:block>
                                                        <xsl:value-of select="@text"/>
                                                </fo:block>
                                        </fo:table-cell>
                                </fo:table-row>
                        </fo:table-body>
                </fo:table>


Old XSL:

<?xml version="1.0"?>
<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="/">
                <xsl:apply-templates select="TIPS"/>
        </xsl:template>
        <xsl:template match="TIPS">
                <xsl:processing-instruction name="cocoon-format">type="text/xslfo"</xsl:processing-instruction>
                <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
                        <fo:layout-master-set>
                                <fo:simple-page-master page-master-name="main" margin-top="5pt" margin-bottom="5pt" margin-left="10pt" margin-right="5pt">
                                        <fo:region-body margin-bottom="5pt" column-count="2" column-gap="15pt"/>
                                </fo:simple-page-master>
                        </fo:layout-master-set>
                        <fo:page-sequence>
                                <fo:flow>
                                        <fo:table space-before.optimum="10pt">
                                                <fo:table-column column-width="270pt"/>
                                                <fo:table-body>
                                                        <fo:table-row>
                                                                <fo:table-cell background-color="blue" text-align="center" color="white" font-weight="bold" font-size="12pt" font-family="sans-serif" line-height="18pt" space-after.optimum="3pt" padding-top="2pt" padding-left="2pt">
                                                                        <fo:block>
                                                                                <xsl:value-of select="Details/@text"/>
                                                                        </fo:block>
                                                                </fo:table-cell>
                                                        </fo:table-row>
                                                </fo:table-body>
                                        </fo:table>


Reply via email to