blob: 0fd72c2258b4ce2ac459c43cf191ff3e6c73071f [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../../dtd/document-v10.dtd">
<document>
<header>
<title>Text Serializer</title>
<version>0.9</version>
<type>Technical document</type>
<authors>
<person name="Carsten Ziegeler" email="cziegeler@apache.org"/>
<person name="Bernhard Huber" email="huber@apache.org"/>
</authors>
<abstract>This document describes the text serializer of Cocoon.</abstract>
</header>
<body>
<s1 title="Text Serializer">
<p>
The Text serializer serializes xml into plain text..
</p>
<ul>
<li>Name : text</li>
<li>Class: org.apache.cocoon.serialization.TextSerializer</li>
<li>Cacheable: yes.</li>
</ul>
<s2 title="Sitemap Configuration">
<p>
The text Serializer is declared in the sitemap serializers section.
</p>
<source><![CDATA[
<map:serializers...
...
<map:serializer name="text"
src="org.apache.cocoon.serialization.TextSerializer"
mime-type="text/plain"
logger="sitemap.serializer.text"
/>
...
]]></source>
<p>
The text Serializer sets the <code>method</code> property
of the XML serializer to the value <code>text</code>.
</p>
</s2>
<s2 title="Pipeline Usage">
<p>
Using the text Serializer in a pipeline is just setting the
serializer type to text.
The following code snippet uses the text Serializer:
</p>
<source><![CDATA[
...
<map:match pattern="announcement.txt">
<map:generate...
...
<map:serialize type="text"/>
...
]]></source>
<p>
The pipeline snippet above serializes the SAX events of the
announcment document resource to plain text.
</p>
<p>
Input document of the text serializer must be valid XML document. It
should have at least one element, root element, which will contain
all the text of the document. Root element will be ignored by text
serializer and will not go into the output stream.
</p>
</s2>
<s2 title="Further Reading">
<p>
As text Serializer uses the XML serializer internally, you might
want to read the complete list of valid XML configuration parameters.
It is available at <link href="xml-serializer.html">XML serializer</link>
user documentation.
</p>
</s2>
</s1>
</body>
</document>