std.xml.element_parser.on_start_tag
- multiple declarations
- Variable ElementParser.onStartTag
- Variable ElementParser.onStartTag
Variable ElementParser.onStartTag
Register a handler which will be called whenever a start 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
start tag
.
Declaration
class ElementParser
{
// ...
void delegate(ElementParser)
onStartTag;
// ...
}
Examples
// Call this function whenever astart tag is encountered onStartTag["podcast"] = (ElementParser xml) { // Your code here // // This is a a closure, so code here may reference // variables which are outside of this scope }; // call myEpisodeStartHandler (defined elsewhere) whenever an // start tag is encountered onStartTag["episode"] = &myEpisodeStartHandler; // call delegate dg for all other start tags onStartTag[null] = dg;
This library will supply your function with a new instance of
ElementHandler, which may be used to parse
inside the element whose
start tag
was just found, or to identify the tag
attributes of the
element, etc.
Note that your function will be called for both start tags and empty tags. That is, we make no distinction between <br></br> and <br/>.
Variable ElementParser.onStartTag
Register a handler which will be called whenever a start 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
start tag
.
Declaration
class ElementParser
{
// ...
void delegate(ElementParser)
onStartTag;
// ...
}
Examples
// Call this function whenever astart tag is encountered onStartTag["podcast"] = (ElementParser xml) { // Your code here // // This is a a closure, so code here may reference // variables which are outside of this scope }; // call myEpisodeStartHandler (defined elsewhere) whenever an // start tag is encountered onStartTag["episode"] = &myEpisodeStartHandler; // call delegate dg for all other start tags onStartTag[null] = dg;
This library will supply your function with a new instance of
ElementHandler, which may be used to parse
inside the element whose
start tag
was just found, or to identify the tag
attributes of the
element, etc.
Note that your function will be called for both start tags and empty tags. That is, we make no distinction between <br></br> and <br/>.
Authors
Janice Caron