Text 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

Text Serializer

The Text serializer serializes xml into plain text..

  • Name : text
  • Class: org.apache.cocoon.serialization.TextSerializer
  • Cacheable: yes.
Sitemap Configuration

The text Serializer is declared in the sitemap serializers section.

<map:serializers...
...
 <map:serializer name="text" 
   src="org.apache.cocoon.serialization.TextSerializer"
   mime-type="text/plain" 
   logger="sitemap.serializer.text" 
 />
...
      

The text Serializer sets the method property of the XML serializer to the value text.

Pipeline Usage

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

...
<map:match pattern="announcement.txt">
<map:generate...
...
<map:serialize type="text"/>
...
      

The pipeline snippet above serializes the SAX events of the announcment document resource to plain text.

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.

Further Reading

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 XML serializer user documentation.

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