You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Scott Jones <sc...@izio.com> on 2000/10/31 10:42:45 UTC
Inconsistent Responses from Dynamic FOP Page?
Hi,
I'm generating a dynamic PDF file using a namespace taglib, and a XSL
transform using FOP. However, I am struggling because I cannot seem to get
my PDF get generated consistently... Oftentimes, a request from the browser
will time-out, but at other times, it works perfectly. I have found no
pattern as to when it fails... I have tried each of the Cocoon FAQ
suggestions for getting IE to work correctly with FOP generated PDFs, but
this problem is plaguing every browser that I have (and creating a servlet
and/or changing the file extension to ".pdf" has not helped with the
consistency). Thanks for any
suggestions that anyone might have...
I am using Cocoon 1.8, Tomcat 3.2 b6, FOP 0.13
Thanks for taking a look!
-Scott
I've got snippets of each of my files listed below:
test.xml
==========================================
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?xml-logicsheet href="test.xsp.xsl"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="test.fo.xsl" type="text/xsl"?>
<xsp:page
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
xmlns:test="http://www.mydomainname.com/test"
>
<page>
<title>Title Here</title>
<section header="Section 1">
<!-- I've got several tags that grab specific info from a
database -->
<test:goGetSomeDatabaseInfo/>
Plus I've got content in here...
</section>
</page>
</xsp:page>
test.xsp.xsl (Tag Library)
=================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
xmlns:test="http://www.mydomainname.com/test"
>
<xsl:template match="xsp:page">
<xsp:page>
<xsl:apply-templates select="@*" />
<xsl:apply-templates />
</xsp:page>
</xsl:template>
<xsl:template match="@*|*|text()|processing-instruction()">
<xsl:copy>
<xsl:apply-templates
select="@*|*|text()|processing-instruction()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="test:goGetSomeDatabaseInfo">
<xsp:expr>
. . . . .
</xsp:expr>
</xsl:template>
<!-- and a whole bunch more tags -->
</xsl:stylesheet>
test.fo.xsl
===============================================
<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">
<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="one"
page-width="8.5in"
page-height="11in"
margin-top="0.5in"
margin-bottom="0.5in"
margin-left="0.5in"
margin-right="0.5in">
<fo:region-before extent="1in"/>
<fo:region-body
margin-top="0.5in"
margin-bottom="0.5in"
margin-right="0.5in"
margin-left="0.5in"/>
<fo:region-after extent="0.5in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence>
<fo:sequence-specification>
<fo:sequence-specifier-repeating
page-master-first="one"
page-master-repeating="one"/>
</fo:sequence-specification>
<fo:static-content flow-name="xsl-after">
<fo:block text-align="end">
<fo:inline-graphic
href="file:/usr/local/tomcat/webapps/ROOT/images/Logo1.gif"
height="1cm"
width="2cm"/>
</fo:block>
</fo:static-content>
<fo:flow>
<fo:block text-align="start">
<fo:inline-graphic
href="file:/usr/local/tomcat/webapps/ROOT/images/titleLogo.gif"
width="6cm"
height="2cm"/>
</fo:block>
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="title">
<fo:block font-size="18pt"
font-family="sans-serif"
text-align-last="centered"
space-before.optimum="18pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="p">
<fo:block font-size="10pt"
font-family="sans-serif"
text-align-last="justify"
space-before.optimum="12pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<!-- and a bunch more formatting definitions here --->
</xsl:stylesheet>
Re: Inconsistent Responses from Dynamic FOP Page?
Posted by Matthew Cordes <mc...@maine.edu>.
There is a newer versio n of FOP, perhaps start there.
-matt
On Tue, Oct 31, 2000 at 01:42:45AM -0800, Scott Jones wrote:
> Hi,
>
> I'm generating a dynamic PDF file using a namespace taglib, and a XSL
> transform using FOP. However, I am struggling because I cannot seem to get
> my PDF get generated consistently... Oftentimes, a request from the browser
> will time-out, but at other times, it works perfectly. I have found no
> pattern as to when it fails... I have tried each of the Cocoon FAQ
> suggestions for getting IE to work correctly with FOP generated PDFs, but
> this problem is plaguing every browser that I have (and creating a servlet
> and/or changing the file extension to ".pdf" has not helped with the
> consistency). Thanks for any
> suggestions that anyone might have...
>
> I am using Cocoon 1.8, Tomcat 3.2 b6, FOP 0.13
>
> Thanks for taking a look!
>
> -Scott
>
>
>
> I've got snippets of each of my files listed below:
>
> test.xml
> ==========================================
> <?xml version="1.0"?>
>
> <?cocoon-process type="xsp"?>
> <?xml-logicsheet href="test.xsp.xsl"?>
> <?cocoon-process type="xslt"?>
> <?xml-stylesheet href="test.fo.xsl" type="text/xsl"?>
>
> <xsp:page
> xmlns:xsp="http://www.apache.org/1999/XSP/Core"
> xmlns:test="http://www.mydomainname.com/test"
> >
> <page>
> <title>Title Here</title>
> <section header="Section 1">
> <!-- I've got several tags that grab specific info from a
> database -->
> <test:goGetSomeDatabaseInfo/>
> Plus I've got content in here...
> </section>
> </page>
> </xsp:page>
>
> test.xsp.xsl (Tag Library)
> =================================================
> <?xml version="1.0"?>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xsp="http://www.apache.org/1999/XSP/Core"
> xmlns:test="http://www.mydomainname.com/test"
> >
> <xsl:template match="xsp:page">
> <xsp:page>
> <xsl:apply-templates select="@*" />
> <xsl:apply-templates />
> </xsp:page>
> </xsl:template>
>
> <xsl:template match="@*|*|text()|processing-instruction()">
> <xsl:copy>
> <xsl:apply-templates
> select="@*|*|text()|processing-instruction()"/>
> </xsl:copy>
> </xsl:template>
>
> <xsl:template match="test:goGetSomeDatabaseInfo">
> <xsp:expr>
> . . . . .
> </xsp:expr>
> </xsl:template>
> <!-- and a whole bunch more tags -->
>
> </xsl:stylesheet>
>
> test.fo.xsl
> ===============================================
> <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">
> <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="one"
> page-width="8.5in"
> page-height="11in"
> margin-top="0.5in"
> margin-bottom="0.5in"
> margin-left="0.5in"
> margin-right="0.5in">
> <fo:region-before extent="1in"/>
> <fo:region-body
> margin-top="0.5in"
> margin-bottom="0.5in"
> margin-right="0.5in"
> margin-left="0.5in"/>
> <fo:region-after extent="0.5in"/>
> </fo:simple-page-master>
> </fo:layout-master-set>
> <fo:page-sequence>
> <fo:sequence-specification>
> <fo:sequence-specifier-repeating
> page-master-first="one"
> page-master-repeating="one"/>
> </fo:sequence-specification>
> <fo:static-content flow-name="xsl-after">
> <fo:block text-align="end">
> <fo:inline-graphic
>
> href="file:/usr/local/tomcat/webapps/ROOT/images/Logo1.gif"
> height="1cm"
> width="2cm"/>
> </fo:block>
> </fo:static-content>
> <fo:flow>
> <fo:block text-align="start">
> <fo:inline-graphic
>
> href="file:/usr/local/tomcat/webapps/ROOT/images/titleLogo.gif"
> width="6cm"
> height="2cm"/>
> </fo:block>
> <xsl:apply-templates/>
> </fo:flow>
> </fo:page-sequence>
> </fo:root>
> </xsl:template>
>
> <xsl:template match="title">
> <fo:block font-size="18pt"
> font-family="sans-serif"
> text-align-last="centered"
> space-before.optimum="18pt">
> <xsl:apply-templates/>
> </fo:block>
> </xsl:template>
>
> <xsl:template match="p">
> <fo:block font-size="10pt"
> font-family="sans-serif"
> text-align-last="justify"
> space-before.optimum="12pt">
> <xsl:apply-templates/>
> </fo:block>
> </xsl:template>
>
> <!-- and a bunch more formatting definitions here --->
>
> </xsl:stylesheet>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>