XML::Struct::Reader - Read ordered XML from a stream
version 0.03
my $stream = XML::LibXML::Reader->new( location => "file.xml" ); my $stream = XML::Struct::Reader->new; my $data = $stream->read( $stream );
This module reads from an XML stream via XML::LibXML::Reader and return a Perl data structure with ordered XML (see XML::Struct).
Create a new reader. By default whitespace is ignored, unless enabled with option whitespace. The option attributes can be set to false to omit all attributes from the result.
whitespace
attributes
Read the root element or the next element element. This method is a shortcut for readNext( $stream, '*' ).
readNext( $stream, '*' )
Read an XML element from a stream and return it as array reference with element name, attributes, and child elements. In contrast to method read, this method expects the stream to be at an element node ($stream->nodeType == 1) or bad things might happed.
read
$stream->nodeType == 1
Read the next element from a stream. The experimental option $path can be used to specify an element name (the empty string or "*" match all element nodes) and a path, such as /some/element. The path operator "../" is not supported.
$path
*
/some/element
../
Read all child elements of an XML element and return the result as array reference or as empty list if no children were found. Significant whitespace is only included if option whitespace is enabled.
Read all XML attributes from a stream and return a hash reference or an empty list if no attributes were found.
Jakob Voß
This software is copyright (c) 2013 by Jakob Voß.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
3 POD Errors
The following errors were encountered while parsing the POD:
Unknown directive: =endocing
Unknown directive: =head
Non-ASCII character seen before =encoding in 'Voß'. Assuming UTF-8
To install XML::Struct, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Struct
CPAN shell
perl -MCPAN -e shell install XML::Struct
For more information on module installation, please visit the detailed CPAN module installation guide.