Simple::SAX::Serializer - Simple XML serializer
Represents xml serializer class,
use Simple::SAX::Serializer; my $xml = Simple::SAX::Serializer; $xml->handler('root/child', sub { my ($self, $element, $parent) = @_; my $attributes = $element->attributes; my $result = $parent->children_array_result; push @$result,Child->new(%$attributes); }); $xml->handler('root', sub { my ($self, $element) = @_; $element->validate_attributes(['dummy'], {attr2 => 'default_value'}); Root->new(%{$element->attributes}, children => $element->children_result); }); my $xml_content = "<?xml version="1.0"?><root dummy="1"><child id="1" ><child id="2" ></root>"; $xml->parse_string($xml_content); # or $xml->parse_file ...
Runs the parser and returns result, xml as string
Runs the parser and returns result, xml as file
Runs the parser and returns result
Finds handler for current element. It start matching from root/element/searched_element and if not find that it try to resolve by element/searched_element and eventually searched_element If handler is not found then generates an error.
Takes array reference of the elements data structures, return list of element name.
The Simple::SAX::Serializer 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.
Simple::SAX::Serializer::Parser XML::LibXML::SAX
Adrian Witas, adrian@webapp.strefa.pl
See also
To install Simple::SAX::Serializer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Simple::SAX::Serializer
CPAN shell
perl -MCPAN -e shell install Simple::SAX::Serializer
For more information on module installation, please visit the detailed CPAN module installation guide.