Serializers
Serializers take the pipeline data as a DOM document and output it to the client. There
are four basic types at present supported within Paloose:
- HTMLSerializer
— outputs simple HTML with option of a leading DOCTYPE declaration and character encoding information.
- XHTMLSerializer
— outputs correct XHTML with option of a leading DOCTYPE declaration and character encoding information.
- TextSerializer
— outputs pure text derived from the content of the pipeline DOM
document.
- XMLSerializer —
outputs the DOM Document as an XML stream.
Component Declaration
Warning
Note that this is a change from all versions prior to 1.13.0.
Serializers are defined in the component declaration part of the Sitemap.
<map:serializers default="xml">
<map:serializer name="html" src="resource://lib/serialization/HTMLSerializer">
<map:property name="doctype-public" value="-//W3C//DTD HTML 4.01 Transitional//EN"/>
<map:property name="doctype-system" value="http://www.w3.org/TR/html4/loose.dtd"/>
<map:property name="encoding" value="UTF-8"/>
</map:serializer>
<map:serializer name="xhtml" src="resource://lib/serialization/XHTMLSerializer">
<map:property name="doctype-public" value="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
<map:property name="doctype-system" value="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<map:property name="encoding" value="UTF-8"/>
</map:serializer>
<map:serializer name="text" src="resource://lib/serialization/TextSerializer"/>
<map:serializer name="xml" src="resource://lib/serialization/XMLSerializer">
<map:property name="doctype-public" value="-//W3C//DTD XHTML 1.0 Strict//EN"/>
<map:property name="doctype-system" value="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
<map:property name="encoding" value="UTF-8"/>
</map:serializers>
The default attribute specifies the type of serializer to use
if none is specified in a pipeline.
Copyright 2006 – 2023 Hugh Field-Richards. All Rights
Reserved.