Bio::OntologyIO::Handlers::BaseSAXHandler - base class for SAX Handlers
Contents
Description
This module is an abstract module, serving as the base of any SAX Handler implementation. It tries to
offer the framework that SAX handlers generally need, such as tag_stack, char_store, etc.
In the implementation handler, you can take advantage of this based module by the following suggestions.
1) In start_element,
sub start_element {
my $self=shift;
my $tag=$_[0]->{Name};
my %args=%{$_[0]->{Attributes}};
# Your code here.
# Before you conclude the method, write these 2 line.
$self->_visited_count_inc($tag);
$self->_push_tag($tag);
}
2) In end_element,
sub end_element {
my $self=shift;
my $tag=shift->{Name};
# Your code here.
# Before you conclude the method, write these 2 lines.
$self->_visited_count_dec($tag);
$self->_pop_tag;
}
3) In characters, or any other methods where you may use the tag stack or count
sub characters {
my $self=shift;
my $text=shift->{Data};
$self->_chars_hash->{$self->_top_tag} .= $text;
}
$count = $self->_visited_count('myTag');
$tag = $self->_top_tag;
Feedback
MailingLists
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments
and suggestions preferably to one of the Bioperl mailing lists.
Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look
at the problem and quickly address it. Please include a thorough description of the problem with code and
data examples if at all possible.
ReportingBugs
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug
reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
Name
Bio::OntologyIO::Handlers::BaseSAXHandler - base class for SAX Handlers
Synopsis
See description.
