# This is CoST -*- tcl -*- script, to display SGML document
# in tree style.

# $Id: script,v 1.2 1998/10/13 08:11:31 tobotras Exp $

require Simple.tcl
require textutil.tcl
require TEItools.tcl

set indent 0
set oldIndent 0
set TAB_WIDTH 4

specification translate {
    {pel} {
	cdataFilter identity
	sdataFilter identity
    }
    {el} {
	cdataFilter null
	sdataFilter null
	startAction {
	    global indent oldIndent
	    puts stdout "[repeatstr " " $oldIndent]" nonewline
	    puts stdout "[repeatstr "-" [expr $indent - $oldIndent]]" nonewline
	    puts "<[query gi]>"
	    global TAB_WIDTH
	    set oldIndent $indent
	    incr indent $TAB_WIDTH
	}
	endAction {
	    global TAB_WIDTH
	    incr indent "-${TAB_WIDTH}"
	}
    }
}
