SGML::ElementMap::Driver - Perl base class for controlling SGML/XML oriented processing


  $obj = new SGML::ElementMap;
  $driver = new SGML::ElementMap::Driver::Grove;
  package SGML::ElementMap::Driver::SOME_MODULE;
  @ISA = qw( SGML::ElementMap::Driver );
  # ...


To facilitate different uses, code managing the interface to the parser or grove resides in interchangeable Driver modules. The module can implicitly select the Grove driver, so the Driver interface can be safely ignored.


Pass a parser object, or the class name for a parser object to instantiate. Returns the old parser or undef if there was a problem.


Pass the type of markup to parse, either SGML or XML. Returning zero means the driver can't do that markup.


Pass the type of input to use, either file for file names, handle for IO references, string or literal for reading from a scalar, or default to guess (scalar is file name, scalar ref is literal, handle ref is, well, a handle).

process(ElementMapObject, Source, ExtraArgs)

Start the processing. ExtraArgs are passed to the top document handler.

process_sgml_file() or process_xml_file()

shortcut for process with file name (these are both redundant, but they are provided from the base class so there's not much point to taking them out).


turn kinds of tracing on. mostly good for debugging, it can help you find out why things aren't working like you think they should.

reparent_subtree(), reparent_current_subtree(), skip_subtree()

internal driver method


internal driver method


return the current element context as ``/'' separated identifiers. (primarily for matching against handler specifications).


Robert Braddock,


perl(1), SGML::ElementMap(3pm), SGML::ElementMap::Driver::Grove(3pm), SGML::ElementMap::Driver::SGMLS(3pm), SGML::ElementMap::Driver::XMLParser(3pm)