You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Alexander Klimetschek <al...@mindquarry.com> on 2007/01/18 23:03:49 UTC

CleanupTransformer + HTMLSerializer = Doctype twice problem

Hi,

when using the CleanupTransformer from the html-block together with the 
o.a.c.serialization.HTMLSerializer I get duplicate Doctype declarations 
at the beginning of the HTML document.

-----------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
...
-----------------------

The HTMLSerializer is configured like this:

<serializer name="html" mime-type="text/html"
     src="org.apache.cocoon.serialization.HTMLSerializer">
   <encoding>UTF-8</encoding>
   <indent>true</indent>
   <doctype-public>-//W3C//DTD HTML 4.01 Transitional//EN</doctype-public>
   <doctype-system>http://www.w3.org/TR/html4/loose.dtd</doctype-system>
</serializer>

And in the sitemap I use as the final transformation steps:

	<transform type="htmlcleanup" />
	<serialize type="html"/>

The transformer factory is configured to be 
org.apache.xalan.xsltc.trax.TransformerFactoryImpl.

If I take the htmlcleanup out of the pipeline, there will be only one 
doctype.

Any ideas?


Alex

-- 
Alexander Klimetschek
http://www.mindquarry.com