.\" Copyright (c) 2000, 2001 Udo Erdelhoff. All rights reserved. .\" Written for the FreeBSD German Documentation Project .\" .\" Redistribution and use in source and compiled forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" .\" 1. Redistributions of source code must retain the above .\" copyright notice, this list of conditions and the following .\" disclaimer as the first lines of this file unmodified. .\" .\" 2. Redistributions in compiled form must reproduce the above .\" copyright notice, this list of conditions and the following .\" disclaimer in the documentation and/or other materials provided .\" with the distribution. .\" .\" THIS DOCUMENTATION IS PROVIDED BY UDO ERDELHOFF "AS IS" AND ANY EXPRESS .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE .\" DISCLAIMED. IN NO EVENT SHALL UDO ERDELHOFF BE LIABLE FOR ANY DIRECT, .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING .\" IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF .\" THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $Id: slashexpand.1,v 1.4 2002/11/24 09:40:48 ue Exp $ .Dd July 25, 2000 .Dt SLASHEXPAND 1 .Os FreeBSD .Sh NAME .Nm slashexpand .Nd fix crippled SMGL tags .Sh SYNOPSIS .Nm .Op Fl Fl debug .Sh DESCRIPTION According to the SGML standard, it is possible to close the current in-line element by specifying .Aq / instead of .Aq /sometag . On the other hand, the use of .Aq / is discouraged .Pq ok, will be discouraged in the style guide chapter of the .Fx Documentation Project Primer for new Contributors. This utility replaces all .Aq / by their correct form. .Pp The .Nm utility works as a filter. The SGML sourcecode is read from the standard input. Character data, SGML comments, precious entities .Pq entities where whitespace and/or linebreaks are significant and elements without content .Pq 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. .Pp For each closing tag encountered in the input stream, one element is .Dq popped .Pq removed from the stack . .Bl -bullet .It 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, .Nm displays an error message and aborts. If the two tags match, the closing tag is copied to the standard output. .It If the closing tag was just .Aq / , the value from the stack is used to fix the closing tag and the repaired tag is copied to the standard output. .El If .Nm is started with the argument .Fl Fl 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. .Sh DIAGNOSTICS The .Nm utility exits 0 on success, and >0 if a unrecoverable error occurs. .Sh HISTORY The first version of the .Nm utility was written on July 25th, 2000. .Sh AUTHORS The .Nm utility and this manual page were written by .An Udo Erdelhoff Aq ue@nathan.ruhr.de in July 2000. .Sh BUGS There is always one bug left but the one .Nm has not been found .Pq yet .