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
Serializers are defined in the component declaration part of the Sitemap.
<map:serializers default="xml">
<map:serializer name="html" src="resource://lib/serialization/HTMLSerializer">
<doctype-public>-//W3C//DTD HTML 4.01 Transitional//EN</doctype-public>
<doctype-system>http://www.w3.org/TR/html4/loose.dtd</doctype-system>
<encoding>iso-8859-1</encoding>
</map:serializer>
<map:serializer name="xhtml" src="resource://lib/serialization/XHTMLSerializer">
<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>iso-8859-1</encoding>
</map:serializer>
<map:serializer name="text" src="resource://lib/serialization/TextSerializer"/>
<map:serializer name="xml" src="resource://lib/serialization/XMLSerializer"/>
</map:serializers>
The default attribute specifies the type of serializer to use
if none is specified in a pipeline.
Copyright 2006 – 2017 Hugh Field-Richards. All Rights
Reserved.