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 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
<HTML>
<HEAD>
<TITLE>What are the different event types and data?</TITLE>
</HEAD>
<BODY>
<P><B>Links</B>: <A HREF=sgmlselement.html>Next</A> <A HREF=sgmlsevent.html>Previous</A> <A HREF=sgmlspm.html>Up</A> <A HREF=sgmlspm.html>Top</A></P>
<H1>What are the different event types and data?</H1>
<P>Table 2 lists the ten
different event types returned by the <TT>next_event</TT>
method of an <A HREF=sgmls.html><TT>SGMLS</TT></A>
object and the different types of data associated with each of these
(note that these do <EM>not</EM> correspond to the
standard <B>ESIS</B> events).</P>
<H3>Table 2: The <TT>SGMLS_Event</TT> types</H3>
<HR>
<DL>
<DT><B>Event Type</B></DT>
<DD><TT>'start_element'</TT></DD>
<DT><B>Event Data</B></DT>
<DD><TT>SGMLS_Element</TT></DD>
<DT><B>Description</B></DT>
<DD>The beginning of an element.</DD>
</DL>
<HR>
<DL>
<DT><B>Event Type</B></DT>
<DD><TT>'end_element'</TT></DD>
<DT><B>Event Data</B></DT>
<DD><TT>SGMLS_Element</TT></DD>
<DT><B>Description</B></DT>
<DD>The end of an element.</DD>
</DL>
<HR>
<DL>
<DT><B>Event Type</B></DT>
<DD><TT>'cdata'</TT></DD>
<DT><B>Event Data</B></DT>
<DD>string</DD>
<DT><B>Description</B></DT>
<DD>Regular character data.</DD>
</DL>
<HR>
<DL>
<DT><B>Event Type</B></DT>
<DD><TT>'sdata'</TT></DD>
<DT><B>Event Data</B></DT>
<DD>string</DD>
<DT><B>Description</B></DT>
<DD>Special system data.</DD>
</DL>
<HR>
<DL>
<DT><B>Event Type</B></DT>
<DD><TT>'re'</TT></DD>
<DT><B>Event Data</B></DT>
<DD>[none]</DD>
<DT><B>Description</B></DT>
<DD>A record-end (i.e., a newline).</DD>
</DL>
<HR>
<DL>
<DT><B>Event Type</B></DT>
<DD><TT>'pi'</TT></DD>
<DT><B>Event Data</B></DT>
<DD>string</DD>
<DT><B>Description</B></DT>
<DD>A processing instruction</DD>
</DL>
<HR>
<DL>
<DT><B>Event Type</B></DT>
<DD><TT>'entity'</TT></DD>
<DT><B>Event Data</B></DT>
<DD><TT>SGMLS_Entity</TT></DD>
<DT><B>Description</B></DT>
<DD>A non-SGML external entity.</DD>
</DL>
<HR>
<DL>
<DT><B>Event Type</B></DT>
<DD><TT>'start_subdoc'</TT></DD>
<DT><B>Event Data</B></DT>
<DD><TT>SGMLS_Entity</TT></DD>
<DT><B>Description</B></DT>
<DD>The beginning of an SGML subdocument.</DD>
</DL>
<HR>
<DL>
<DT><B>Event Type</B></DT>
<DD><TT>'end_subdoc'</TT></DD>
<DT><B>Event Data</B></DT>
<DD><TT>SGMLS_Entity</TT></DD>
<DT><B>Description</B></DT>
<DD>The end of an SGML subdocument.</DD>
</DL>
<HR>
<DL>
<DT><B>Event Type</B></DT>
<DD><TT>'conforming'</TT></DD>
<DT><B>Event Data</B></DT>
<DD>[none]</DD>
<DT><B>Description</B></DT>
<DD>The document was valid.</DD>
</DL>
<HR>
<P>For example, if <TT>$event->type</TT> returns
<TT>'start_element'</TT>, then
<TT>$event->data</TT> will return an object belonging to the
<A HREF=sgmlselement.html><TT>SGMLS_Element</TT></A>
class (which will contain a list of attributes, etc. -- see
below), <TT>$event->file</TT> and
<TT>$event->line</TT> will return the file and line-number
in which the element appeared (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), and
<TT>$event->element</TT> will return the element currently
in force (in this case, the same as
<TT>$event->data</TT>).</P>
<P><B>Links</B>: <A HREF=sgmlselement.html>Next</A> <A HREF=sgmlsevent.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>
|