NAME

XML::Elemental::Element - a generic element (tag) object.

DESCRIPTION

XML::Elemental::Element is a subclass of XML::Elemental::Node that is used by the Elemental parser to represent a tag.

METHODS

XML::Elemental::Element->new

Parameterless constructor. Returns an instance of the object.

$element->name([$name])

Returns the tag name as a string in Clarkian notation -- {namespace}tag. See process_name in MT::Elemental::Util for a routine that can split this namespace-qualified name into its individual parts. If you are setting the element name it must be in this same notation.

$element->parent([$element])

Returns a the parent element object. If a object parameter is passed the parent is set. The object is assumed to be or have an interface like XML::Elemental::Element.

$element->contents([\@children])

Returns an ordered array reference of direct sibling objects. Returns a reference to an empty array if the element does not have any siblings. If a parameter is passed all the direct siblings are (re)set.

$element->attributes([\%attributes])

Returns a HASH reference of key-value pairs representing the tag's attributes. It returns a reference to an empty hash if the element does not have any attributes. If a parameter is passed all attributes are (re)set. Like the element name, keys must be in Clarkian notation.

$element->text_content

A method that returns the character data of all siblings as a string.

$element->root

Inherited from XML::Elemental::Node, returns the top most object ancestor. Typically this will be a XML::Element::Document object.

$element->ancestors

Inherited from XML::Elemental::Node, returns an ordered array of elements starting with the closest ancestor and ending with the root.

$element->in_element($element)

Inherited from XML::Elemental::Node, this method will test if the required XML::Elemental::Element parameter is an ancestor of the current object and return a boolean value.

AUTHOR & COPYRIGHT

Please see the XML::Elemental manpage for author, copyright, and license information.

4 POD Errors

The following errors were encountered while parsing the POD:

Around line 45:

=begin without a target?

Around line 59:

'=item' outside of any '=over'

Around line 118:

You forgot a '=back' before '=head1'

Around line 125:

'=end' without a target?