NAME

SGML::SPGrove - load an SGML, XML, or HTML document

SYNOPSIS

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, ...);

DESCRIPTION

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.

$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.

$grove->root returns the SGML::Element of the outermost element of the document.

$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->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->notations returns a reference to an array containing any notations referenced in this grove.

Refer to SGML::Grove for details of as_string, iter, accept, accept_gi, children_accept, children_accept_gi.

AUTHOR

Ken MacLeod, ken@bitsko.slc.ut.us

SEE ALSO

perl(1), SGML::Grove(3) <http://www.jclark.com/sp/> <http://www.jclark.com/sp/sysid.htm>