Home| base |src.bin|xmldoc| scdoc Index

scdoc

Syntax
scdoc --help
scdoc table script
Synopsis

Simple script search and replace function.

Options
--helpprint the help message and exit.
tablefilename of the file containing the table of search and replace terms.
scriptoutline text script.
Description

The program performs simple search and replace operations on a text file known as a script. The script file contains special tags in the form of HTML comments that are replaced with text taken from a lookup table.

The lookup table is an XML database containing a list of tags to search for and the replacement text to subsitute:

<table>
<entry>
<search>NAME</search>
<replace>Robin Barnes</replace>
</entry>

<entry>
<search>MAIL</search>
<replace>robin.barnes@jhuapl.edu</replace>
</entry>
</table>

The script is an ASCII file and can be either plain text or HTML;

<body>
<h1>Welcome, <!--NAME--></h1>
<p>Your email address is <!--MAIL--></p>
</body>

In the above example the two HTML comments are replaced with the text from the lookup table:

<body>
<h1>Welcome, Robin Barnes</h1>
<p>Your email address is robin.barnes@jhuapl.edu</p>
</body>

The lookup table and script are read from the two files specified on the command line, the resultant output text is written to standard output.

This program is primarily used to generate HTML pages for the documentation system.

Examples
scdoc table.xml page.script > page.html

Read the lookup table from the file "table.xml" and use it to replace text in the script "page.script". Write the HTML output to the file "page.html".