query_container_callers()
>void|mapping(string:function) query_container_callers()
The query_tag_callers() method is called by
Challenger to find all plain tags handled by the module. It returns a
mapping of string, function pairs where the string is the name of the
tag and the function is a callback method that handles that tag. The
method need not be implemented if a particular parser module has no
plain tags but only container tags.
The definition for the actual callback method is:
void|string|array(string) container_caller( string tag,
mapping (string:string) att, string contents, object id)
tag contains the name of the tag being parsed. It makes it
possible to have one tag caller that handles several tags slightly
differently. att contains the attributes sent to the
tag. contents contains the contents that were enclosed between
the start and end tags. id is the request information object.
Thus <tag hi>Hello</tag> will be called with ({ "hi" :
"hi" }) as att and "Hello" as contents.
The return value will usually be a string that will replace the
tag. The string will in turn will be RXML parsed. Thus a tag caller
can return RXML that will be parsed. Care must however be taken to
quote things properly before returning them, otherwise it might be
possible for a user to get his input RXML parsed.
If zero is returned the tag will be left as is. If an array
containing one string is returned the tag will be replaced with that
string, but the string won't be RXML parsed.
|