apache > cocoon
 
Font size:      

XHTML Serializer (2.1 legacy document)

Warning
This document was copied as is from the Cocoon 2.1 documentation, but has not yet been fully reviewed or moved to its new home.

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-max="64"
     >
     <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//ENspecifies the XHTML public document type
doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtdspecifies the XHTML system document type
mime-typetext/htmlspecifies 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.

Comments

add your comments