XML::ExtOn::Element - Class for Element object.
use XML::ExtOn; my $buf; my $wrt = XML::ExtOn::Writer->new( Output => \$buf ); my $ex_parser = new XML::ExtOn:: Handler => $wrt; ... #create Element my $elem = $ex_parser->mk_element("Root"); $elem->add_content( $elem->mk_element("tag1")); ... #delete tag from XML $elem->delete_element; ... #delete tag from XML and skip content $elem->delete_element->skip_content; ... #set default namespace( scoped in element ) $elem->add_namespace(''=>"http://example.com/defaultns"); ... #get attribites by prefix my $hash_ref = $elem->attrs_by_prefix('myprefix'); $hash_ref->{attr1} = 1; $ex_parser->start_element($elem) $ex_parser->end_element;
Add commands to contents stack.Return $self
$self
$elem->add_content( $self->mk_from_xml("<p/>"), $self->mk_cdata("TEST CDATA"), )
Wrap by element object.Return $self
element object
$elem->insert_to( $self->mk_element('wrap') )
Wrap around element object.Return $self
Create element object in namespace of element.
Add Namespace mapping. return $self
If Prefix eq '', this namespace will then apply to all elements that have no prefix.
Prefix
$elem->add_namespace( "myns" => 'http://example.com/myns', "myns_test", 'http://example.com/myns_test', ''=>'http://example.com/new_default_namespace' );
Return default Namespace_URI for Element scope.
Return localname of elemnt ( without prefix )
Return reference to hash of attributes for Prefix.
Return reference to hash of attributes for Namespace_URI.
Return reference to hash of attributes by name.
Skip entry of element. Return $self
Return 1 - if element marked to skip content
Delete start and close element from stream. return $self
Return 1 - if element marked to delete
XML::ExtOn, XML::SAX::Base
Zahatski Aliaksandr, <zag@cpan.org>
Copyright (C) 2007-2008 by Zahatski Aliaksandr
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install XML::ExtOn, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::ExtOn
CPAN shell
perl -MCPAN -e shell install XML::ExtOn
For more information on module installation, please visit the detailed CPAN module installation guide.