The Translator Class

SGML applications are represented by instances of the Translator class within InfoPrism.

Methods

name
Returns name of output format.
outfile NODE
Returns output file for the document node NODE or an empty string.

Text Processing

quote TEXT
Replaces special characters within TEXT and returns result.

Entities

transents ENT
Translates entity ENT to the appropriate representation for this format.

Translation

formatsubmaybe NODE
Formats descendants of NODE and returns the result unless NODE is empty.

Index

Create New Translators

New translators have to be derived from the base class InfoPrism::Translator. The constructor must call the constructor of the base class with the name of the output format to which the translator belongs and pass any arguments to the builtin configure method.
package require Trans
namespace eval InfoPrism {namespace eval Example {}}

class InfoPrism::Example::Translator {
	inherit InfoPrism::Translator

	constructor {args} {
		InfoPrism::Translator::constructor example
	} {
		eval configure $args
	}
}

Overriding Methods

Several methods of the base class are just placeholders for translator-specific implementations. In the most cases it is useful to override them. One example is quote.

Concept Index


Written by Stefan Hornburg <racke@gundel.han.de>
Translated from translator.tcl by Info Prism's sgml2html v0.0.6
Last modified 01. January 1999