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

Main
User Documentation

Generators
Overview

Default
File Generator

Core
HTML Generator
Directory Generator
Image Directory Generator
Fragment Extractor Generator
JSP Generator
Script Generator
Server Pages Generator
Velocity Generator
Request Generator
Status Generator
Stream Generator
Profile Generator
Error Generator
Search Generator
LinkStatus Generator
Web Service Proxy Generator
Text Parser Generator

Optional
Php Generator
XML:DB Generator
XML:DB Collection Generator

Text Parser Generator

The text parser generator parser a text file, which an specified grammar, and generates a XML file from it.

  • Name : textparser
  • Class: org.apache.cocoon.generation.TextParserGenerator
  • Cacheable: yes - uses the last modification date of the text document and of the grammar file for validation.

The location of the source xml document is specified in the pipeline by the src attribute.

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

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

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.