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";
Currently, sgml.pl
is not very suffisticated.
It cannot handle complex
SGML documents, is slow, and inefficient with memory usage. The
library is best used on small documents.
&'SGMLread_sgml(
FILEHANDLE,
*
array_r);
SGMLread_sgml
reads SGML markup. The
*
array_r is the returned array
that contains tags separated from text.
I.e.
SGMLread_sgml
splits the
markup tags from text. Each array item is either a markup tag or a
text. The order of tag/text items are the order they appear in the
SGML document.
After SGMLread_sgml
is called, one only needs to
`shift' thru the
items to read the SGML. If the item begins with a `<` it is a tag,
else it is text.
All comment declarations, `<!-- -->', are deleted.
SGMLread_sgml
is not intended to parse a DTD, or an SGML
delcaration statement, `<SGML ...>'. It is designed to parse SGML
instances.
Marked sections are not recognized.
Element with CDATA content can screw things up if they contain `<` or `>' characters.
Attributes with `<` or `>' characters will screw things up
This program is part of the perlSGML package; see <URL:http://www.oac.uci.edu/indiv/ehood/perlSGML.html>