cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira>
Subject Re: Generating plain text on Cocoon 2.1.6
Date Tue, 03 May 2005 08:29:11 GMT
Martin Holmes wrote:
> I'm having problems generating plain text output (utf-8) on Cocoon 
> 2.1.6. I get a NullPointerException. The scenario is:
>       <map:match pattern="proof/*.txt">
>         <map:generate src="abstracts_for_proofing/{1}.xml"/>
>         <map:transform type="xinclude"/>
>         <map:transform type="xslt" src="xsl/text_out.xsl"/>
>         <map:serialize type="text" />
>       </map:match>
> The XML files are UTF-8 and the XSL file starts out like this:
> <xsl:output method="text" encoding="utf-8" media-type="text/plain"/>
> <xsl:template match="/">
>      <xsl:processing-instruction
> name="cocoon-format">type="text/plain"</xsl:processing-instruction>
>      <plain-text>
>         <xsl:apply-templates />
>     </plain-text>
> </xsl:template>
> The XSL works fine running locally in oXygen with Saxon 6.5.3. I've 
> tried removing the processing instruction, but it makes no difference. 
> I've also tried adding a UTF-8 text serializer to the sitemap like this:
> <map:serializer logger="sitemap.serializer.text" mime-type="text/plain"
>         name="text" src="org.apache.cocoon.serialization.TextSerializer">
>         <encoding>UTF-8</encoding>
>       </map:serializer>
> but no joy.
> I've included the top few lines of the stack trace below. Can anyone 
> suggest what the problem might be?

Thanks for the other stack trace. Unfortunately, those ones are usually 
very difficult to debug, as the error shows up in Xalan as a null 
pointer exception, which was actually triggered by something much 
further back in the pipeline.

Now, have you tried replacing <map:serialize type="text"/> with 
<map:serialize type="xml"/>

What do you see? Does it produce your text content, but wrapped in XML?

Also, the processing instruction, to my knowledge, won't make any 
difference. It looks like a Cocoon 1.x instruction, that Cocoon 2 
doesn't know about. Configuration like that happens in the sitemap, not 
in processing instructions.

Regards, Upayavira

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message