cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pier Fumagalli <p...@betaversion.org>
Subject Re: HTMLSerializer problem
Date Tue, 21 Feb 2006 10:35:56 GMT
On 21 Feb 2006, at 09:41, Josias Thoeny wrote:

> Hi,
>
> I didn't get any feedback on the user list for this one...
>
> I updated my local copy of cocoon 2.1.x and now I'm getting an
> exception when I serialize with the HTMLSerializer (serializer block),
> see the relevant part of the stacktrace:
>
> [...]
> Caused by: java.lang.NullPointerException: Required System ID is NULL
>         at
> org.apache.cocoon.components.serializers.util.DocType.<init> 
> (DocType.java:76)
>         at
> org.apache.cocoon.components.serializers.HTMLSerializer.body 
> (HTMLSerializer.java:158)
>         at
> org.apache.cocoon.components.serializers.EncodingSerializer.startEleme 
> nt(EncodingSerializer.java:459)
>         at
> org.apache.xml.serializer.ToXMLSAXHandler.closeStartTag 
> (ToXMLSAXHandler.java:204)
>         at
> org.apache.xml.serializer.ToSAXHandler.flushPending 
> (ToSAXHandler.java:277)
>         at
> org.apache.xml.serializer.ToXMLSAXHandler.startPrefixMapping 
> (ToXMLSAXHandler.java:348)
>         at
> org.apache.xalan.templates.ElemElement.constructNode 
> (ElemElement.java:328)
>         at
> org.apache.xalan.templates.ElemElement.execute(ElemElement.java:288)
>         at
> org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes 
> (ElemApplyTemplates.java:393)
>         at
> org.apache.xalan.templates.ElemApplyTemplates.execute 
> (ElemApplyTemplates.java:176)
>         at
> org.apache.xalan.transformer.TransformerImpl.executeChildTemplates 
> (TransformerImpl.java:2411)
>         ... 101 more
>
> I didn't configure a default doctype for the serializer, so it uses  
> the
> following one (defined in HTMLSerializer.java):
>
> public static final DocType HTML401_DOCTYPE_COMPATIBLE = new
> SGMLDocType(
>         "HTML", "-//W3C//DTD HTML 4.01 Transitional//EN", null);
>
> The system ID is null, which causes the mentioned problem when the
> following code is executed (around line 158 in HTMLSerializer.java):
>
> this.doctype = new DocType(this.doctype.getName().toUpperCase(),
>                this.doctype.getPublicId(),
>                this.doctype.getSystemId());
>
> When I change new DocType(...) to new SGMLDoctype(...) it works.
>
> Here is my configuration of the serializer:
> <map:serializer logger="sitemap.serializer.html" mime-type="text/html;
> charset=utf-8" name="html" pool-grow="4" pool-max="32" pool-min="4"
> src="org.apache.cocoon.components.serializers.HTMLSerializer">
>   <encoding>UTF-8</encoding>
> </map:serializer>
>
> Is there something wrong with my configuration or is this a bug?  
> Anybody
> else having this problem?

Ah... That might be something I committed last week, as I was working  
exactly on doctype behavior... That said, it works on my local host  
here, so, I'll try to replicate your error...

	Pier



Mime
View raw message