| 1 |
<HTML> |
| 2 |
<HEAD> |
| 3 |
<TITLE>So what do I do with an event?</TITLE> |
| 4 |
</HEAD> |
| 5 |
<BODY> |
| 6 |
|
| 7 |
<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> |
| 8 |
|
| 9 |
<H1>So what do I do with an event?</H1> |
| 10 |
|
| 11 |
<P>The <TT>next_event</TT> method for the <A HREF=sgmls.html><TT>SGMLS</TT></A> class returns an |
| 12 |
object belonging to the class <TT>SGMLS_Event</TT>. |
| 13 |
This class has several methods available, as listed in table 1.</P> |
| 14 |
|
| 15 |
|
| 16 |
<H3>Table 1: The <TT>SGMLS_Event</TT> class</H3> |
| 17 |
|
| 18 |
<HR> |
| 19 |
<DL> |
| 20 |
<DT><B>Method</B></DT> |
| 21 |
<DD><TT>type</TT></DD> |
| 22 |
<DT><B>Return Type</B></DT> |
| 23 |
<DD>string</DD> |
| 24 |
<DT><B>Description</B></DT> |
| 25 |
<DD>Return the type of the event.</DD> |
| 26 |
|
| 27 |
</DL> |
| 28 |
<HR> |
| 29 |
|
| 30 |
|
| 31 |
<DL> |
| 32 |
<DT><B>Method</B></DT> |
| 33 |
<DD><TT>data</TT></DD> |
| 34 |
<DT><B>Return Type</B></DT> |
| 35 |
<DD>string, <TT>SGMLS_Element</TT>, or |
| 36 |
<TT>SGMLS_Entity</TT></DD> |
| 37 |
<DT><B>Description</B></DT> |
| 38 |
<DD>Return any data associated with the event.</DD> |
| 39 |
|
| 40 |
</DL> |
| 41 |
<HR> |
| 42 |
|
| 43 |
|
| 44 |
<DL> |
| 45 |
<DT><B>Method</B></DT> |
| 46 |
<DD><TT>file</TT></DD> |
| 47 |
<DT><B>Return Type</B></DT> |
| 48 |
<DD>string</DD> |
| 49 |
<DT><B>Description</B></DT> |
| 50 |
<DD>Return the name of the <A HREF="http://www.sil.org/sgml/sgml.html"><B>SGML</B></A> source file which generated the |
| 51 |
event, if available.</DD> |
| 52 |
|
| 53 |
</DL> |
| 54 |
<HR> |
| 55 |
|
| 56 |
|
| 57 |
<DL> |
| 58 |
<DT><B>Method</B></DT> |
| 59 |
<DD><TT>line</TT></DD> |
| 60 |
<DT><B>Return Type</B></DT> |
| 61 |
<DD>string</DD> |
| 62 |
<DT><B>Description</B></DT> |
| 63 |
<DD>Return the line number of the <A HREF="http://www.sil.org/sgml/sgml.html"><B>SGML</B></A> source file which |
| 64 |
generated the event, if available.</DD> |
| 65 |
|
| 66 |
</DL> |
| 67 |
<HR> |
| 68 |
|
| 69 |
|
| 70 |
<DL> |
| 71 |
<DT><B>Method</B></DT> |
| 72 |
<DD><TT>element</TT></DD> |
| 73 |
<DT><B>Return Type</B></DT> |
| 74 |
<DD><TT>SGMLS_Element</TT></DD> |
| 75 |
<DT><B>Description</B></DT> |
| 76 |
<DD>Return the element in force when the event was |
| 77 |
generated.</DD> |
| 78 |
|
| 79 |
</DL> |
| 80 |
<HR> |
| 81 |
|
| 82 |
|
| 83 |
<DL> |
| 84 |
<DT><B>Method</B></DT> |
| 85 |
<DD><TT>parse</TT></DD> |
| 86 |
<DT><B>Return Type</B></DT> |
| 87 |
<DD>Return the <TT>SGMLS</TT> object for the current |
| 88 |
parse.</DD> |
| 89 |
|
| 90 |
</DL> |
| 91 |
<HR> |
| 92 |
|
| 93 |
|
| 94 |
<DL> |
| 95 |
<DT><B>Method</B></DT> |
| 96 |
<DD><TT>entity(<IT>ename</IT>)</TT></DD> |
| 97 |
<DT><B>Return Type</B></DT> |
| 98 |
<DD>Look up an entity from those currently known to the parse. An |
| 99 |
alias for <TT>->parse->entity($ename)</TT></DD> |
| 100 |
|
| 101 |
</DL> |
| 102 |
<HR> |
| 103 |
|
| 104 |
|
| 105 |
<DL> |
| 106 |
<DT><B>Method</B></DT> |
| 107 |
<DD><TT>notation(<IT>nname</IT>)</TT></DD> |
| 108 |
<DT><B>Return Type</B></DT> |
| 109 |
<DD>Look up the notation from those currently known to the parse: |
| 110 |
an alias for <TT>->parse->notation($nname)</TT>.</DD> |
| 111 |
|
| 112 |
</DL> |
| 113 |
<HR> |
| 114 |
|
| 115 |
|
| 116 |
<P>The <TT>file</TT> and <TT>line</TT> methods |
| 117 |
will return useful information only if you called <TT>sgmls</TT> or <A HREF="http://www.jclark.com/sp.html"><TT>nsgmls</TT></A> |
| 118 |
with the <IT>-l</IT> flag to include file and |
| 119 |
line-number information.</P> |
| 120 |
|
| 121 |
|
| 122 |
<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> |
| 123 |
|
| 124 |
|
| 125 |
<ADDRESS>David Megginson <A HREF="mailto:[email protected]"><[email protected]></A></ADDRESS> |
| 126 |
</BODY> |
| 127 |
</HTML> |