SLASHEXPAND(1)

NAME
slashexpand - fix crippled SMGL tags

SYNOPSIS
slashexpand [- -debug]

DESCRIPTION
According to the SGML standard, it is possible to close the current in-line element by specifying </> instead of </sometag>. On the other hand, the use of </> is discouraged (ok, will be discouraged) in the style guide chapter of the FreeBSD Documentation Projekt Primer for new Contributors. This utility replaces all </> by their correct form.

The slashexpand utility works as a filter. The SGML sourcecode is read from the standard input. Character data, SGML comments, precious entities (entities where whitespace and/or linebreaks are significant) and elements without content (like anchor) are simply copied to the standard output. Opening tags are pushed onto an internal stack before they are copied to the standard output.

For each closing tag encountered in the input stream, one element is “popped” (removed from the stack).

•   If the closing tag was complete, the value removed from the stack is used to check the sequence of opening and closing tags. If the closing tag does not match the opening tag, slashexpand displays an error message and aborts. If the two tags match, the closing tag is copied to the standard output.

•   If the closing tag was just </>, the value from the stack is used to fix the closing tag and the repaired tag is copied to the standard output.
If slashexpand is started with the argument - -debug, the sequence of push and pop operations and other debugging information is included into the ouput. This feature can be used to debug bad SGML sourcecode.

DIAGNOSTICS
The slashexpand utility exits 0 on success, and >0 if a unrecoverable error occurs.

HISTORY
The first version of the slashexpand utility was written on July 25th, 2000.

AUTHORS
The slashexpand utility and this manual page were written by Udo Erdelhoff <ue@nathan.ruhr.de> in July 2000.

BUGS
There is always one bug left but the one slashexpand has not been found (yet).