In addition to the generic events listed in the previous section, sgmlspl allows special, specific handlers for the beginning and end of elements and subdocument entities, for SDATA strings, and for external data entities. Table 2 lists the different specific event types available.
Note that these override the generic-event handlers. For example, if you were to type
sgml('&FOO;', sub { output "Found a \"foo\" entity!\n"; }); sgml('entity', sub { output "Found an entity!\n"; });
And the external data entity &FOO; appeared in your SGML document, sgmlspl would call the first handler rather than the second.
Note also that start and end handlers are entirely separate things: if an element has a specific start handler but no specific end handler, the generic end handler will still be called at the end of the element. To prevent this, declare a handler with an empty string:
sgml('</HACK>', '');David Megginson <dmeggins@aix1.uottawa.ca>