Links: Next Previous Up Top

# What are the different event types and data?

Table 2 lists the ten different event types returned by the `next_event` method of an `SGMLS` object and the different types of data associated with each of these (note that these do not correspond to the standard ESIS events).

### Table 2: The `SGMLS_Event` types

Event Type
  `'start_element'`
Event Data
  `SGMLS_Element`
Description
  The beginning of an element.

Event Type
  `'end_element'`
Event Data
  `SGMLS_Element`
Description
  The end of an element.

Event Type
  `'cdata'`
Event Data
  string
Description
  Regular character data.

Event Type
  `'sdata'`
Event Data
  string
Description
  Special system data.

Event Type
  `'re'`
Event Data
  [none]
Description
  A record-end (i.e., a newline).

Event Type
  `'pi'`
Event Data
  string
Description
  A processing instruction

Event Type
  `'entity'`
Event Data
  `SGMLS_Entity`
Description
  A non-SGML external entity.

Event Type
  `'start_subdoc'`
Event Data
  `SGMLS_Entity`
Description
  The beginning of an SGML subdocument.

Event Type
  `'end_subdoc'`
Event Data
  `SGMLS_Entity`
Description
  The end of an SGML subdocument.

Event Type
  `'conforming'`
Event Data
  [none]
Description
  The document was valid.

For example, if `$event->type` returns `'start_element'`, then `$event->data` will return an object belonging to the `SGMLS_Element` class (which will contain a list of attributes, etc. -- see below), `$event->file` and `$event->line` will return the file and line-number in which the element appeared (if you called `onsgmls`, `sgmls` or `nsgmls` with the -l flag), and `$event->element` will return the element currently in force (in this case, the same as `$event->data`).

Links: Next Previous Up Top