SGML::SPGrove - load an SGML, XML, or HTML document
use SGML::SPGroveBuilder; $grove = SGML::SPGroveBuilder->new ($sysid); $root = $grove->root; $errors = $grove->errors; $entities = $grove->entities; $notations = $grove->notations; Other grove methods defined by SGML::Grove: $grove->as_string([$context, ...]); $grove->iter; $grove->accept($visitor, ...); $grove->accept_gi($visitor, ...); $grove->children_accept($visitor, ...); $grove->children_accept_gi($visitor, ...);
new loads an SGML, XML, or HTML document instance from $sysid using James Clark's SGML Parser (SP), returning a ``grove'' that contains the root, or top, element of the document, an array of any warnings or errors that may have been generated while parsing the document, and arrays of notations and entities used within the document.
new
$sysid
$sysid is most often the file name of the SGML instance to be parsed, but can be any of the ids described in ``System Identifiers'' in SP's documentation. For example, $sysid can also be a URL, `-' for standard input, a literal string ("<LITERAL>$scalar"), or a formal system identifier.
-
<LITERAL>$scalar
$grove->root returns the SGML::Element of the outermost element of the document.
$grove->root
SGML::Element
$grove->errors returns a reference to an array containing any errors generated by SP or SGML::SPGroveBuilder while parsing the document or building the grove.
$grove->errors
$grove->entities returns a reference to a hash containing any entities referenced in this grove (as opposed to entities that may have been declared but not used).
$grove->entities
$grove->notations returns a reference to an array containing any notations referenced in this grove.
$grove->notations
Refer to SGML::Grove for details of as_string, iter, accept, accept_gi, children_accept, children_accept_gi.
as_string
iter
accept
accept_gi
children_accept
children_accept_gi
Ken MacLeod, ken@bitsko.slc.ut.us
perl(1), SGML::Grove(3) <http://www.jclark.com/sp/> <http://www.jclark.com/sp/sysid.htm>
To install SGML::SPGroveBuilder, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SGML::SPGroveBuilder
CPAN shell
perl -MCPAN -e shell install SGML::SPGroveBuilder
For more information on module installation, please visit the detailed CPAN module installation guide.