Text Serializer

User Documentation


HTML Serializer

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

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:serializer name="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: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.