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
|
<!DOCTYPE module>
<module name='StreamListener'>
A template for stream parser listeners. Note that the declarations (attlistdecl, elementdecl, etc) are trivially processed; REXML doesn't yet handle doctype entity declarations, so you have to parse them out yourself.
<method name='tag_start'>
Called when a tag is encountered.
</method>
<method name='tag_end'>
Called when the end tag is reached. In the case of <tag/>, tag_end will be called immidiately after tag_start
</method>
<method name='text'>
Called when text is encountered in the document
</method>
<method name='instruction'>
Called when an instruction is encountered. EG: <?xsl sheet='foo'?>
</method>
<method name='comment'>
Called when a comment is encountered.
</method>
<method name='doctype'>
Handles a doctype declaration. Any attributes of the doctype which are not supplied will be nil. # EG, <!DOCTYPE me PUBLIC "foo" "bar">
</method>
<method name='attlistdecl'>
If a doctype includes an ATTLIST declaration, it will cause this method to be called. The content is the declaration itself, unparsed. EG, <!ATTLIST el attr CDATA #REQUIRED> will come to this method as "el attr CDATA #REQUIRED". This is the same for all of the .*decl methods.
</method>
<method name='elementdecl'>
<!ELEMENT ...>
</method>
<method name='entitydecl'>
<!ENTITY ...>
</method>
<method name='notationdecl'>
<!NOTATION ...>
</method>
<method name='entity'>
Called when %foo; is encountered in a doctype declaration.
</method>
<method name='cdata'>
Called when <![CDATA[ ... ]]> is encountered in a document.
</method>
<method name='xmldecl'>
Called when an XML PI is encountered in the document. EG: <?xml version="1.0" encoding="utf"?>
</method>
</module>
|