cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Bachta" <tbac...@kopent.com>
Subject Cocoon xml:fo question
Date Wed, 14 May 2003 15:08:12 GMT
Hi all,  I don't know if this is the right place for this question,
hopefully someone here can help me, but I am having some trouble
displaying a table of data in a PDF file.  I have no problem displaying
this data in html using cocoon but my transition to the PDF format has
been a little rough to say the least.  Here is the code that I am using.


 

Xsp

 

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page language="java" xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
xmlns:xsp-session="http://apache.org/xsp/session/2.0">

       <xsp:structure>

             <xsp:include>java.util.Date</xsp:include>

       </xsp:structure>

       <xsp:logic>

             Date now = new Date();

       </xsp:logic>

       <page>

             <title>Overdue Tasks as of <xsp:expr>now</xsp:expr>

             </title>

             <content>

                    <esql:connection>

                           <esql:pool>vyzo</esql:pool>

                           <esql:execute-query>

                                 <esql:query>

                                 execute rptOverdueTasks

                           </esql:query>

                                 <esql:results>

                                        <tasks>

                                               <esql:row-results>

                                                     <task>

 
<esql:get-columns/>

                                                     </task>

                                               </esql:row-results>

                                        </tasks>

                                 </esql:results>

                           </esql:execute-query>

                    </esql:connection>

             </content>

       </page>

</xsp:page>

 

 

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="page">

       <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

             <fo:layout-master-set>

                    <fo:simple-page-master master-name="page"
page-height="11in" page-width="8.5in">

                           <fo:region-body region-name="xsl-region-body"
margin="0.7in" />

                           <fo:region-before
region-name="xsl-region-before" extent="0.7in" />

                           <fo:region-after
region-name="xsl-region-after" extent="0.7in" />

                    </fo:simple-page-master>

                    

                    

             </fo:layout-master-set>

             

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

                    <fo:static-content flow-name="xsl-region-after">

                           <fo:block text-align="center"
font-size="10pt" font-family="Courier" line-height="14pt">

                           Page

                           <fo:page-number/>

                           </fo:block>

                    </fo:static-content>

                    <fo:flow flow-name="xsl-region-body" >

                           <xsl:apply-templates/>

                    </fo:flow>

             </fo:page-sequence>

       </fo:root>

</xsl:template>

 

<xsl:template match="title">

       <fo:block font-size="16pt" font-family="Helvetica"
space-before.optimum="24pt" text-aling="center">

             <xsl:apply-templates/>

       </fo:block>

</xsl:template>

 

<xsl:template match="paragraph">

       <fo:block font-size="12pt" font-family="Times"
space-before.optimum="12pt" text-aling="center">

             <xsl:apply-templates/>

       </fo:block>

</xsl:template>

 

 

<xsl:template match="tasks">

       <fo:table border="solid 1px black">

             <fo:table-body>

                    <xsl:apply-templates/>

             </fo:table-body>

       </fo:table>

</xsl:template>

 

<xsl:template match="task">

       <xsl:for-each select="*">

             <fo:table-row>

                    <fo:table-cell border="solid 1px red">

                           <fo:block><xsl:apply-templates/></fo:block>

                    </fo:table-cell>

             </fo:table-row>

       </xsl:for-each>

</xsl:template>

 

</xsl:stylesheet>

 

 

I am getting the title and the page number on the PDF and nothing else.
If anyone can help or please point me in the right direction it would be
greatly appreciated.  I am new to this environment and have found it
very useful and cool so far, so please excuse my ignorance if I made a
stupid mistake.

 

Thanks in Advance, 

 

Tim Bachta

 

 

 


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message