XHTML Serializer
http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Main
User Documentation

Serializers
Overview

Default
HTML Serializer

Core
XHTML Serializer
XML Serializer
Text Serializer
WAP/WML Serializer
SVG Serializer
SVG/XML Serializer
SVG/JPEG Serializer
SVG/PNG Serializer
SVG/TIFF Serializer
VRML Serializer
Link Serializer
Zip archive Serializer

Optional
PDF Serializer
PS Serializer
PCL Serializer
HSSF (XLS) Serializer

XHTML Serializer

The XHTML serializer serializes sax events to XHTML. The output of the XHTML serializer is XHTML.

  • Name : xhtml
  • Class: org.apache.cocoon.serialization.XMLSerializer
  • Cacheable: yes
Sitemap Configuration

The XHTML serializer is declared in the sitemap serializers section.

<map:serializers ...
...
   <map:serializer name="xhtml"
     src="org.apache.cocoon.serialization.XMLSerializer"
     mime-type="text/html" 
     logger="sitemap.serializer.xhtml"
     pool-grow="2" pool-max="64" pool-min="2" 
     >
     <doctype-public>-//W3C//DTD XHTML 1.0 Strict//EN</doctype-public>
     <doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</doctype-system>
     <encoding>UTF-8</encoding>
   </map:serializer>
...
      

The declaration of the XHTML serializer shall use following XML serializer configuration parameters

NameValueComment
doctype-public-//W3C//DTD XHTML 1.0 Strict//EN specifies the XHTML public document type
doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd specifies the XHTML system document type
mime-typetext/html specifies mime-type of the serialized XHTML document.
Pipeline Usage

Using the XHTML Serializer in a pipeline is just setting the serializer type to xhtml. The following code snippet uses the XHTML Serializer:

<map:match pattern="*.html">
...
  <map:serialize type="xhtml"/>
</map:match>
...
      
Further Reading

As XHTML serializer uses the XML serializer internally, you might want to read the complete list of valid XML configuration parameters. It is available at XML serializer user docuementation.

Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.