NAME

Simple::SAX::Serializer::Element - XML node element.

SYNOPSIS

   my $xml = Simple::SAX::Serializer->new;
   $xml->handler('dataset', sub {
            my ($self, $element, $parent) = @_;
            my $attributes = $element->attributes;
            my $children_result = $element->children_result;
            {properties => $attributes, dataset => $children_result}
        }
    );
    $xml->handler('*', sub {
        my ($self, $element, $parent) = @_;
        my $attributes = $element->attributes;
        my $children_result = $parent->children_array_result;
        my $result = $parent->children_result;
        push @$children_result, $element->name => {%$attributes};
    });
}

DESCRIPTION

Represents xml node element.

EXPORT

None.

ATTRIBUTES

node

Stores reference to the xml node.

METHODS

attributes

Return attributes as hash ref.

name
children_result

Returns children results.

children_array_result

Returns children result as array ref

children_hash_result

Returns children result as hash ref

set_children_result

Sets children result

value

Return element's value.

validate_attributes

Validates element attributes takes, required attributes parameter as array ref, optional attributes parameter as hash ref $element->validate_attributes(['name'], {type => 'text'});

COPYRIGHT

The Simple::SAX::Serializer::Element module is free software. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

SEE ALSO

Simple::SAX::Serializer Simple::SAX::Serializer::Parser

AUTHOR

Adrian Witas, <adrian@webapp.strefa.pl</gt>

See also