cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josias Thoeny <josias.tho...@wyona.com>
Subject HTMLSerializer problem
Date Tue, 21 Feb 2006 09:41:04 GMT
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.startElement(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?

Josias





Mime
View raw message