™.. Data::Grove::Visitor - Online Linux Manual PageSection : 3
Updated : 2003-10-21
Source : perl v5.10.1
Note : User Contributed Perl Documentation

NAMEData::Grove::Visitor − add visitor/callback methods to Data::Grove objects

SYNOPSIS​ use Data::Grove::Visitor; ​ ​ @results = $object−>accept ($visitor, ...); ​ @results = $object−>accept_name ($visitor, ...); ​ @results = $object−>children_accept ($visitor, ...); ​ @results = $object−>children_accept_name ($visitor, ...);

DESCRIPTIONData::Grove::Visitor adds visitor methods (callbacks) to Data::Grove objects. A ``visitor'' is a class (a package) you write that has methods (subs) corresponding to the objects in the classes being visited. You use the visitor methods by creating an instance of your visitor class, and then calling `\*(C`accept($my_visitor)\*(C'\fR' on the top-most object you want to visit, that object will in turn call your visitor back with `\*(C`visit_\f(CIOBJECT\f(CW\*(C'\fR', where \fI\s-1OBJECT\s0\fR is the type of object. There are several forms of `\*(C`accept\*(C'\fR'. Simply calling `\f(CW\*(C`accept\*(C'\fR' calls your package back using the object type of the object you are visiting. Calling `\*(C`accept_name\*(C'\fR' on an element object calls you back with `\*(C`visit_name_\f(CINAME\f(CW\*(C'\fR' where \fI\s-1NAME\s0\fR is the tag name of the element, on all other objects it's as if you called `\*(C`accept\*(C'\fR'. All of the forms of `\*(C`accept\*(C'\fR' return a concatenated list of the result of all `\*(C`visit\*(C'\fR' methods. `\*(C`children_accept\*(C'\fR' calls `\f(CW\*(C`accept\*(C'\fR' on each of the children of the element. This is generally used in element callbacks to recurse down into the element's children, you don't need to get the element's contents and call `\*(C`accept\*(C'\fR' on each item. `\f(CW\*(C`children_accept_name\*(C'\fR' does the same but calling `\*(C`accept_name\*(C'\fR' on each of the children. `\*(C`attr_accept\*(C'\fR' calls `\f(CW\*(C`accept\*(C'\fR' on each of the objects in the named attribute. Refer to the documentation of the classes you are visiting (XML::Grove, etc.) for the type names (`\*(C`element\*(C'\fR', `\f(CW\*(C`document\*(C'\fR', etc.) of the objects it implements.

RESERVED NAMESThe hash keys `\*(C`Contents\*(C'\fR' and `\f(CW\*(C`Name\*(C'\fR' are used to indicate objects with children (for `\*(C`children_accept\*(C'\fR') and named objects (for `\*(C`accept_name\*(C'\fR').

NOTESThese are random ideas that haven't been implemented yet: • Several objects fall into subclasses, or you may want to be able to subclass a visited object and still be able to tell the difference. In SGML::Grove I had used the package name in the callback (`\*(C`visit_SGML_Element\*(C'\fR') instead of a generic name (`\*(C`visit_element\*(C'\fR'). The idea here would be to try calling `\*(C`visit_\f(CIPACKAGE\f(CW\*(C'\fR' with the most specific class first, then try superclasses, and lastly to try the generic.

AUTHORKen MacLeod, ken@bitsko.slc.ut.us

SEE ALSOperl(1), Data::Grove Extensible Markup Language (XML) <http://www.w3c.org/XML>
0
Johanes Gumabo
Data Size   :   11,249 byte
man-Data::Grove::Visitor.3pmBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 168,264
Visitor ID   :     :  
Visitor IP   :   18.223.239.65   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|Data::Grove::Visitor.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|Data::Grove::Visitor.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|Data::Grove::Visitor.3pm|41|br══─}─══|'br══─}─══ )         (htmlprn|149|Data::Grove::Visitor.3pm|41|'br══─}─══ |'br══─}─══ )         (rof_nr_x|149|Data::Grove::Visitor.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (rof_unit_scale_px|41|Data::Grove::Visitor.3pm|51/52|F|.ie \nF ══─{─══. de IX )         (rof_if|19|Data::Grove::Visitor.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (htmlprn|149|Data::Grove::Visitor.3pm|51/52|.ie \nF ══─{─══. de IX|.ie \nF ══─{─══. de IX )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|53|\$1\t\\n%\t"\\$2" |. tm Index:\\$1\t\\n%\t"\\$2" )         (parse_manual_page_|249|Data::Grove::Visitor.3pm|57|══─}─══|.══─}─══ )         (htmlprn|149|Data::Grove::Visitor.3pm|57|.══─}─══ |.══─}─══ )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|150|\*(C`accept($my_visitor)\*(C'\fR' on the |visitor class, and then calling `\f(CW\*(C`accept($my_visitor)\*(C'\fR' on the )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|152|\*(C`visit_\f(CIOBJECT\f(CW\*(C'\fR', where \fI\s-1OBJECT\s0\fR is the type of |visitor back with `\f(CW\*(C`visit_\f(CIOBJECT\f(CW\*(C'\fR', where \fI\s-1OBJECT\s0\fR is the type of )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|155|\*(C`accept\*(C'\fR'. Simply calling `\f(CW\*(C`accept\*(C'\fR' |There are several forms of `\f(CW\*(C`accept\*(C'\fR'. Simply calling `\f(CW\*(C`accept\*(C'\fR' )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|157|\*(C`accept_name\*(C'\fR' on an element object calls you |visiting. Calling `\f(CW\*(C`accept_name\*(C'\fR' on an element object calls you )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|158|\*(C`visit_name_\f(CINAME\f(CW\*(C'\fR' where \fI\s-1NAME\s0\fR is the tag name of the |back with `\f(CW\*(C`visit_name_\f(CINAME\f(CW\*(C'\fR' where \fI\s-1NAME\s0\fR is the tag name of the )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|159|\*(C`accept\*(C'\fR'. |element, on all other objects it's as if you called `\f(CW\*(C`accept\*(C'\fR'. )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|161|\*(C`accept\*(C'\fR' return a concatenated list of the |All of the forms of `\f(CW\*(C`accept\*(C'\fR' return a concatenated list of the )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|162|\*(C`visit\*(C'\fR' methods. |result of all `\f(CW\*(C`visit\*(C'\fR' methods. )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|164|\*(C`children_accept\*(C'\fR' calls `\f(CW\*(C`accept\*(C'\fR' on each of the children of the |`\f(CW\*(C`children_accept\*(C'\fR' calls `\f(CW\*(C`accept\*(C'\fR' on each of the children of the )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|167|\*(C`accept\*(C'\fR' on each item. `\f(CW\*(C`children_accept_name\*(C'\fR' |contents and call `\f(CW\*(C`accept\*(C'\fR' on each item. `\f(CW\*(C`children_accept_name\*(C'\fR' )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|168|\*(C`accept_name\*(C'\fR' on each of the children. |does the same but calling `\f(CW\*(C`accept_name\*(C'\fR' on each of the children. )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|169|\*(C`attr_accept\*(C'\fR' calls `\f(CW\*(C`accept\*(C'\fR' on each of the objects in the named |`\f(CW\*(C`attr_accept\*(C'\fR' calls `\f(CW\*(C`accept\*(C'\fR' on each of the objects in the named )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|173|\*(C`element\*(C'\fR', `\f(CW\*(C`document\*(C'\fR', |(XML::Grove, etc.) for the type names (`\f(CW\*(C`element\*(C'\fR', `\f(CW\*(C`document\*(C'\fR', )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|177|\*(C`Contents\*(C'\fR' and `\f(CW\*(C`Name\*(C'\fR' are used to indicate objects |The hash keys `\f(CW\*(C`Contents\*(C'\fR' and `\f(CW\*(C`Name\*(C'\fR' are used to indicate objects )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|178|\*(C`children_accept\*(C'\fR') and named objects (for |with children (for `\f(CW\*(C`children_accept\*(C'\fR') and named objects (for )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|179|\*(C`accept_name\*(C'\fR'). |`\f(CW\*(C`accept_name\*(C'\fR'). )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|187|\*(C`visit_SGML_Element\*(C'\fR') instead of a generic name |(`\f(CW\*(C`visit_SGML_Element\*(C'\fR') instead of a generic name )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|188|\*(C`visit_element\*(C'\fR'). The idea here would be to try calling |(`\f(CW\*(C`visit_element\*(C'\fR'). The idea here would be to try calling )         (rof_escape_sequence|91|Data::Grove::Visitor.3pm|189|\*(C`visit_\f(CIPACKAGE\f(CW\*(C'\fR' with the most specific class first, then try |`\f(CW\*(C`visit_\f(CIPACKAGE\f(CW\*(C'\fR' with the most specific class first, then try )