sgml.pl is a Perl library that parses an SGML
document instance.
If installed correctly, the following Perl statement can be used to access the library routines:
require "sgml.pl";
&SGMLread_sgml(FILEHANDLE);
SGMLread_sgml reads SGML markup. Callbacks are called
when certain events occur to do any processing on the data. The
callbacks should be set before the call to SGMLread_sgml.
The following lists the events and the callback invoked:
&$sgml'OpenTagFunc($gi, $attribute_list);&$sgml'EndTagFunc($gi);&$sgml'CommentFunc(*comment_text);&$sgml'ProcInsFunc(*pi_text);&$sgml'CdataFunc(*cdata);SGMLread_sgml is not intended to parse a DTD, or an
SGML declaration statement, '<!SGML ...>'. It is
designed to parse SGML instances. If a "<!" sequence
is encountered (and not part of a comment declaration,
SGMLread_sgml tries to ignore the declaration.
Marked sections are not recognized.
The $sgml'CdataFunc may be called consective times for
a contiguous character data segment.
This program is part of the perlSGML package; see <URL:file:/usr/doc/perlsgml/perlSGML.html>