Hello, I am attempting to use the stylesheet included below to transform an XML file to PDF using Cocoon 2.0.1. My hope to build multiple tables in the PDF file. I have created two templates in the stylesheet for opening and closing a table.
When running this through Cocoon, I get a NullPointerException in Xalan (TransformerImpl.run(TransformerImpl.java:3174)). If I uncomment the <fo:table> tags in the stylesheet comment the call to the two templates, it runs fine through Cocoon. Since I will create about 6 tables in this file, I would like to have a template to open the table and setup the columns instead of coding the same thing several times. Would anyone have any ideas how to get around this? <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="table-page" page-height="600pt" page-width="850pt"> <fo:region-body region-name="table-region" margin-left="25pt" margin-top="25pt" margin-right="25pt" margin-bottom="25pt"/> </fo:simple-page-master> <fo:page-sequence-master master-name="table-sequence"> <fo:repeatable-page-master-reference master-reference="table-page"/> </fo:page-sequence-master> </fo:layout-master-set> <fo:page-sequence master-reference="table-sequence"> <fo:flow flow-name="table-region"> <fo:block font-size="8pt"> <!-- <fo:table border-style="solid" table-omit-header-at-break="true"> --> <xsl:call-template name="OpenPDFTable"/> <fo:table-column column-number="1" column-width="80pt"/> <fo:table-column column-number="2" column-width="80pt"/> <fo:table-header border-style="solid"> <fo:table-row keep-with-next="always"> <fo:table-cell column-number="1" number-columns-spanned="2" padding="2pt" background-color="#003366"> <fo:block color="#FFFFFF">Total Mechandise Discounts & Adjustments</fo:block> </fo:table-cell> </fo:table-row> </fo:table-header> <fo:table-body> <fo:table-row> <fo:table-cell column-number="1" border-style="solid" padding="2pt"> <fo:block>9099</fo:block> </fo:table-cell> <fo:table-cell column-number="2" border-style="solid" padding="2pt"> <fo:block>NTB - SOUTH</fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> <!-- </fo:table> --> <xsl:call-template name="ClosePDFTable"/> </fo:block> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> <xsl:template name="OpenPDFTable"> <xsl:text disable-output-escaping="yes"> <fo:table border-style="solid" table-omit-header-at-break="true"> </xsl:text> </xsl:template> <xsl:template name="ClosePDFTable"> <xsl:text disable-output-escaping="yes"> </fo:table> </xsl:text> </xsl:template> </xsl:stylesheet> __________________________________________________ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>