You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Josias Thoeny <jo...@wyona.com> on 2006/02/15 11:48:48 UTC

HTMLSerializer problem

Hi,

I just 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?

Josias




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