Text Parser Transformer
http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Main
User Documentation

Transformers
Overview

Default
XSLT Transformer

Core
Fragment Extractor Transformer
I18n Transformer
Log Transformer
SQL Transformer
Filter Transformer
Read DOM Session Transformer
Write DOM Session Transformer
XInclude Transformer
CInclude Transformer
EncodeURL Transformer
SourceWriting Transformer
Augment Transformer
Text Parser Transformer

Optional
XT Transformer
LDAP Transformer

Text Parser Transformer

The text parser transformer parse the content of special marked element of a SAX stream, by using a grammar file.

  • Name : textparser
  • Class: org.apache.cocoon.transformation.TextFragmentParserTransformer
  • Cacheable: yes - uses the last modification date of the grammar document for validation.

The parser parse following elements from the SAX stream, and replace them through generated documents.

<tf:textfragment xmlns:tf="http://chaperon.sourceforge.net/schema/textfragment/1.0">
 [Text, which should be parsed]
</tf:textfragment>

The parameter to specify the grammar must be declared. The second parameter tells the parser if it should include all obsolete tokens, and must not specified.

<map:transform type="textparser">
 <map:parameter name="grammar" value="example.grm"/>
 <map:parameter name="includeignorabletokens" value="false"/>
</map:transform>

The explanation of function and the grammar format can be found at the howto section

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