1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
|
<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>onsgmls</TT>, <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>
|