The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Bio::Phylo::Util::DOM::DocumentI - Abstract interface class for flexible XML document object model implementation

SYNOPSIS

Not used directly.

DESCRIPTION

This module describes an abstract implementation of a DOM document as expected by Bio::Phylo. The methods here must be overridden in any concrete implementation. The idea is that different implementations use a particular XML DOM package, binding the methods here to analogous package methods.

This set of methods is intentionally minimal. The concrete instances of this class should inherit both from DocumentI and the underlying XML DOM object class, so that package-specific methods can be directly accessed from the instantiated object.

AUTHOR

Mark A. Jensen - maj -at- fortinbras -dot- us

Constructor

new()
 Type    : Constructor
 Title   : new
 Usage   : $doc = Bio::Phylo::Util::Dom::Document->new(@args)
 Function: Create a Document object using the underlying package
 Returns : Document object or undef on fail
 Args    : Package-specific arguments

Document property accessors/mutators

set_encoding()
 Type    : Mutator
 Title   : set_encoding
 Usage   : $doc->set_encoding($enc)
 Function: Set encoding for document
 Returns : True on success
 Args    : Encoding descriptor as string
get_encoding()
 Type    : Accessor
 Title   : get_encoding
 Usage   : $doc->get_encoding()
 Function: Get encoding for document
 Returns : Encoding descriptor as string
 Args    : none
set_root()
 Type    : Mutator
 Title   : set_root
 Usage   : $doc->set_root($elt)
 Function: Set the document's root element
 Returns : True on success
 Args    : Element object
get_root()
 Type    : Accessor
 Title   : get_root
 Usage   : $doc->get_root()
 Function: Get the document's root element
 Returns : Element object or undef if DNE
 Args    : none

Document element accessors

get_element_by_id()
 Type    : Accessor
 Title   : get_element_by_id
 Usage   : $doc->get_element_by_id($id)
 Function: Get element having id $id
 Returns : Element object or undef if DNE
 Args    : id designator as string
get_elements_by_tagname()
 Type    : Accessor
 Title   : get_elements_by_tagname
 Usage   : $elt->get_elements_by_tagname($tagname)
 Function: Get array of elements having given tag name 
 Returns : Array of elements or undef if no match
 Args    : tag name as string

Output methods

to_xml_string()
 Type    : Serializer
 Title   : to_xml_string
 Usage   : $doc->to_xml_string
 Function: Create XML string from document
 Returns : XML string
 Args    : Formatting arguments as allowed by underlying package
to_xml_file()
 Type    : Serializer
 Title   : to_xml_file
 Usage   : $doc->to_xml_file()
 Function: Create XML file from document
 Returns : True on success
 Args    : filename, formatting arguments as allowed by underlying package

Internal methods

throw_not_implemented()
 Type    : Exception
 Title   : throw_not_implemented
 Usage   : $elt->throw_not_implemented
 Function: Throw exception to indicate a method is not overridden in an
           instance class
 Returns : Bio::Phylo::Util::Exceptions object
 Args    : none
_rearrange()
 Type    : 
 Title   : _rearrange
 Usage   : my ($arg1, $arg2, ...) = _rearrange( [qw( arg1 arg2 ... )], @input_args
 Function: Assign a named argument list to subroutine-local variables
 Returns : rearranged argument values
 Args    : arrayref to argument names, copy of argument array
 Note    : Ripped from BioPerl RootI.pm