<HTML> <HEAD> <TITLE>So what do I do with an event?</TITLE> </HEAD> <BODY> <P><B>Links</B>: <A HREF=events.html>Next</A> <A HREF=sgmls.html>Previous</A> <A HREF=sgmlspm.html>Up</A> <A HREF=sgmlspm.html>Top</A></P> <H1>So what do I do with an event?</H1> <P>The <TT>next_event</TT> method for the <A HREF=sgmls.html><TT>SGMLS</TT></A> class returns an object belonging to the class <TT>SGMLS_Event</TT>. This class has several methods available, as listed in table 1.</P> <H3>Table 1: The <TT>SGMLS_Event</TT> class</H3> <HR> <DL> <DT><B>Method</B></DT> <DD><TT>type</TT></DD> <DT><B>Return Type</B></DT> <DD>string</DD> <DT><B>Description</B></DT> <DD>Return the type of the event.</DD> </DL> <HR> <DL> <DT><B>Method</B></DT> <DD><TT>data</TT></DD> <DT><B>Return Type</B></DT> <DD>string, <TT>SGMLS_Element</TT>, or <TT>SGMLS_Entity</TT></DD> <DT><B>Description</B></DT> <DD>Return any data associated with the event.</DD> </DL> <HR> <DL> <DT><B>Method</B></DT> <DD><TT>file</TT></DD> <DT><B>Return Type</B></DT> <DD>string</DD> <DT><B>Description</B></DT> <DD>Return the name of the <A HREF="http://www.sil.org/sgml/sgml.html"><B>SGML</B></A> source file which generated the event, if available.</DD> </DL> <HR> <DL> <DT><B>Method</B></DT> <DD><TT>line</TT></DD> <DT><B>Return Type</B></DT> <DD>string</DD> <DT><B>Description</B></DT> <DD>Return the line number of the <A HREF="http://www.sil.org/sgml/sgml.html"><B>SGML</B></A> source file which generated the event, if available.</DD> </DL> <HR> <DL> <DT><B>Method</B></DT> <DD><TT>element</TT></DD> <DT><B>Return Type</B></DT> <DD><TT>SGMLS_Element</TT></DD> <DT><B>Description</B></DT> <DD>Return the element in force when the event was generated.</DD> </DL> <HR> <DL> <DT><B>Method</B></DT> <DD><TT>parse</TT></DD> <DT><B>Return Type</B></DT> <DD>Return the <TT>SGMLS</TT> object for the current parse.</DD> </DL> <HR> <DL> <DT><B>Method</B></DT> <DD><TT>entity(<IT>ename</IT>)</TT></DD> <DT><B>Return Type</B></DT> <DD>Look up an entity from those currently known to the parse. An alias for <TT>->parse->entity($ename)</TT></DD> </DL> <HR> <DL> <DT><B>Method</B></DT> <DD><TT>notation(<IT>nname</IT>)</TT></DD> <DT><B>Return Type</B></DT> <DD>Look up the notation from those currently known to the parse: an alias for <TT>->parse->notation($nname)</TT>.</DD> </DL> <HR> <P>The <TT>file</TT> and <TT>line</TT> methods will return useful information only if you called <TT>sgmls</TT> or <A HREF="http://www.jclark.com/sp.html"><TT>nsgmls</TT></A> with the <IT>-l</IT> flag to include file and line-number information.</P> <P><B>Links</B>: <A HREF=events.html>Next</A> <A HREF=sgmls.html>Previous</A> <A HREF=sgmlspm.html>Up</A> <A HREF=sgmlspm.html>Top</A></P> <ADDRESS>David Megginson <A HREF="mailto:dmeggins@aix1.uottawa.ca"><dmeggins@aix1.uottawa.ca></A></ADDRESS> </BODY> </HTML>