ElementParser.onEndTag

Register a handler which will be called whenever an end tag is encountered which matches the specified name. You can also pass null as the name, in which case the handler will be called for any unmatched end tag.

class ElementParser
ElementHandler[string] onEndTag;

Examples

1 // Call this function whenever a </podcast> end tag is encountered
2 onEndTag["podcast"] = (in Element e)
3 {
4     // Your code here
5     //
6     // This is a a closure, so code here may reference
7     // variables which are outside of this scope
8 };
9 
10 // call myEpisodeEndHandler (defined elsewhere) whenever an </episode>
11 // end tag is encountered
12 onEndTag["episode"] = &myEpisodeEndHandler;
13 
14 // call delegate dg for all other end tags
15 onEndTag[null] = dg;

Note that your function will be called for both start tags and empty tags. That is, we make no distinction between &lt;br&gt;&lt;/br&gt; and &lt;br/&gt;.

Meta

Suggestion Box / Bug Report