You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mike Casey <we...@gmail.com> on 2006/02/11 06:48:33 UTC

pdf serializer

Hi guys,

I am currently trying to get the pdf serializer to work and am having a
rather large amount of difficulty.

My serializer in the sitemap is declared as the default

    <map:serializer logger="sitemap.serializer.fo2pdf"
mime-type="application/pdf" name="fo2pdf" src="
org.apache.cocoon.serialization.FOPSerializer">
    </map:serializer>

becasue I am not interested in adding any extra configuration files.

My pipeline when calling the pdf is
  <map:match pattern="*.pdf">
        <map:generate
src="xmldb:xindice://localhost:8888/db/pages/#/page[@name='{1}']"/>
            <map:transform src="resources/xslt/text.xslt">
                      <map:parameter name="contextPath"
value="{request:contextPath}"/>
              </map:transform>
        <map:serialize type="fo2pdf"/>
    </map:match>

However I get the following error

*java.lang.NullPointerException*  context://resources/xslt/text.xslt - 0:0**

*Failed to process pipeline* context://resources/xslt/text.xslt - 0:0*
[TransformerException]*  context://sitemap.xmap - 806:39*<map:serialize
type="fo2pdf">*  context://sitemap.xmap - 803:53*<map:transform>* 
context://sitemap.xmap
- 802:87*<map:generate>*
This has been bugging me for a couple of days considering I thought it would
be rather straight foward to used the pdf serializer. I have tried adding a
config file but that did not alter the
error. If anyone could point me in the right direction I would be more that
grateful

Regards

Mike Casey
NZ

Re: pdf serializer

Posted by Mike Casey <we...@gmail.com>.
Fantastic I finally get it.

I have a very nice looking hello world pdf :-)

Thanks for you help guys

Mike

On 2/11/06, Andrew Stevens <at...@hotmail.com> wrote:
>
> >From: Mike Casey <we...@gmail.com>
> >Date: Sat, 11 Feb 2006 19:48:20 +1300
> >
> >Thanks for the response
> >
> >1)Yes Xindice is returning XML no problem
> >2)What is valid xsl-fo code? If it helps the XHTML serializer, HTML
> >serializer and text serializer are working correctly
>
> XSL Formatting Objects.  In the same way that the HTML serialiser expects
> the incoming XML stream to be valid XHTML and the HSSF (Excel) serialiser
> expects XML that conforms to Gnumeric's file format, the FOP (PDF)
> serialiser excepts valid XSL-FO.
> For more info about XSL-FO, try these links:
> http://www.w3.org/TR/xsl/slice6.html#fo-section
> http://www.xml.com/pub/a/2002/03/20/xsl-fo.html
> http://www.w3schools.com/xslfo/default.asp
> http://www.google.co.uk/search?&q=xsl-fo
>
>
> Andrew.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: pdf serializer

Posted by Andrew Stevens <at...@hotmail.com>.
>From: Mike Casey <we...@gmail.com>
>Date: Sat, 11 Feb 2006 19:48:20 +1300
>
>Thanks for the response
>
>1)Yes Xindice is returning XML no problem
>2)What is valid xsl-fo code? If it helps the XHTML serializer, HTML
>serializer and text serializer are working correctly

XSL Formatting Objects.  In the same way that the HTML serialiser expects 
the incoming XML stream to be valid XHTML and the HSSF (Excel) serialiser 
expects XML that conforms to Gnumeric's file format, the FOP (PDF) 
serialiser excepts valid XSL-FO.
For more info about XSL-FO, try these links:
http://www.w3.org/TR/xsl/slice6.html#fo-section
http://www.xml.com/pub/a/2002/03/20/xsl-fo.html
http://www.w3schools.com/xslfo/default.asp
http://www.google.co.uk/search?&q=xsl-fo


Andrew.



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


Re: pdf serializer

Posted by Mike Casey <we...@gmail.com>.
Thanks for the response

1)Yes Xindice is returning XML no problem
2)What is valid xsl-fo code? If it helps the XHTML serializer, HTML
serializer and text serializer are working correctly
3)I am currently using 2.1.8

Thanks heaps

MIke

On 2/11/06, Antonio Gallardo <ag...@agssa.net> wrote:
>
> Hi,
>
> 1- Verify that xindice returns a valid xml file. Using a pipeline as this:
>
> <map:match pattern="*.pdf.xindice.test.xml">
>         <map:generate
> src="xmldb:xindice://localhost:8888/db/pages/#/page[@name='{1}']"/>
>         <map:serialize type="xml"/>
>     </map:match>
>
> 2-Make sure you xslt tranformation works and produce valid xsl-fo code:
>
>   <map:match pattern="*.pdf.xslt.test.xml">
>         <map:generate
> src="xmldb:xindice://localhost:8888/db/pages/#/page[@name='{1}']"/>
>             <map:transform src="resources/xslt/text.xslt">
>                       <map:parameter name="contextPath"
> value="{request:contextPath}"/>
>               </map:transform>
>         <map:serialize type="xml"/>
>     </map:match>
>
> 3-If both pipelines returns valid code, then it can be a fop error.
> There are some constructions that fop does not support [1]
>
> BTW, wich cocoon version are you using.
>
> Best Regards,
>
> Antonio Gallardo.
>
> [1] - http://xmlgraphics.apache.org/fop/compliance.html
>
> Mike Casey wrote:
>
> > Hi guys,
> >
> > I am currently trying to get the pdf serializer to work and am having
> > a rather large amount of difficulty.
> >
> > My serializer in the sitemap is declared as the default
> >
> >     <map:serializer logger=" sitemap.serializer.fo2pdf"
> > mime-type="application/pdf" name="fo2pdf"
> > src="org.apache.cocoon.serialization.FOPSerializer">
> >     </map:serializer>
> >
> > becasue I am not interested in adding any extra configuration files.
> >
> > My pipeline when calling the pdf is
> >   <map:match pattern="*.pdf">
> >         <map:generate
> > src="xmldb:xindice://localhost:8888/db/pages/#/page[@name='{1}']"/>
> >             <map:transform src="resources/xslt/text.xslt">
> >                       <map:parameter name="contextPath"
> > value="{request:contextPath}"/>
> >               </map:transform>
> >         <map:serialize type="fo2pdf"/>
> >     </map:match>
> >
> > However I get the following error
> >
> > *java.lang.NullPointerException*
> > context://resources/xslt/text.xslt - 0:0      //
> >
> >
> > *Failed to process pipeline*
> > context://resources/xslt/text.xslt - 0:0      /[TransformerException]/
> > context://sitemap.xmap - 806:39       /<map:serialize type="fo2pdf">/
> > context://sitemap.xmap - 803:53       /<map:transform>/
> > context://sitemap.xmap - 802:87       /<map:generate>/
> >
> >
> > This has been bugging me for a couple of days considering I thought it
> > would be rather straight foward to used the pdf serializer. I have
> > tried adding a config file but that did not alter the
> > error. If anyone could point me in the right direction I would be more
> > that grateful
> >
> > Regards
> >
> > Mike Casey
> > NZ
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: pdf serializer

Posted by Antonio Gallardo <ag...@agssa.net>.
Hi,

1- Verify that xindice returns a valid xml file. Using a pipeline as this:

<map:match pattern="*.pdf.xindice.test.xml">
        <map:generate 
src="xmldb:xindice://localhost:8888/db/pages/#/page[@name='{1}']"/>
        <map:serialize type="xml"/>
    </map:match>

2-Make sure you xslt tranformation works and produce valid xsl-fo code:

  <map:match pattern="*.pdf.xslt.test.xml">
        <map:generate 
src="xmldb:xindice://localhost:8888/db/pages/#/page[@name='{1}']"/>
            <map:transform src="resources/xslt/text.xslt">
                      <map:parameter name="contextPath" 
value="{request:contextPath}"/>
              </map:transform>
        <map:serialize type="xml"/>
    </map:match>

3-If both pipelines returns valid code, then it can be a fop error. 
There are some constructions that fop does not support [1]

BTW, wich cocoon version are you using.

Best Regards,

Antonio Gallardo.

[1] - http://xmlgraphics.apache.org/fop/compliance.html

Mike Casey wrote:

> Hi guys,
>
> I am currently trying to get the pdf serializer to work and am having 
> a rather large amount of difficulty.
>
> My serializer in the sitemap is declared as the default
>
>     <map:serializer logger=" sitemap.serializer.fo2pdf" 
> mime-type="application/pdf" name="fo2pdf" 
> src="org.apache.cocoon.serialization.FOPSerializer">
>     </map:serializer>
>
> becasue I am not interested in adding any extra configuration files.
>
> My pipeline when calling the pdf is
>   <map:match pattern="*.pdf">
>         <map:generate 
> src="xmldb:xindice://localhost:8888/db/pages/#/page[@name='{1}']"/>
>             <map:transform src="resources/xslt/text.xslt">
>                       <map:parameter name="contextPath" 
> value="{request:contextPath}"/>
>               </map:transform>
>         <map:serialize type="fo2pdf"/>
>     </map:match>
>
> However I get the following error
>
> *java.lang.NullPointerException*
> context://resources/xslt/text.xslt - 0:0 	//
>
>
> *Failed to process pipeline*
> context://resources/xslt/text.xslt - 0:0 	/[TransformerException]/
> context://sitemap.xmap - 806:39 	/<map:serialize type="fo2pdf">/
> context://sitemap.xmap - 803:53 	/<map:transform>/
> context://sitemap.xmap - 802:87 	/<map:generate>/
>
>
> This has been bugging me for a couple of days considering I thought it 
> would be rather straight foward to used the pdf serializer. I have 
> tried adding a config file but that did not alter the
> error. If anyone could point me in the right direction I would be more 
> that grateful
>
> Regards
>
> Mike Casey
> NZ



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