NAME
XML::Struct::Reader - Read ordered XML from a stream
VERSION
version 0.02
SYNOPSIS
my $stream = XML::LibXML::Reader->new( location => "file.xml" );
my $stream = XML::Struct::Reader->new;
my $data = $stream->read( $stream );
# while
# depth <
# $transform = XML::Struct::Reader->new;
DESCRIPTION
This module reads from an XML stream via XML::LibXML::Reader and return a Perl data structure with ordered XML (see XML::Struct).
METHODS
new( %options )
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.
read( $stream )
Read the root element or the next element element. This method is a shortcut for readNext( $stream, '*' )
.
readElement( $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.
readNext( $stream, $path )
readContent( $stream )
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.
AUTHOR
Jakob Voß
COPYRIGHT AND LICENSE
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.
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 169:
Unknown directive: =head
- Around line 176:
Non-ASCII character seen before =encoding in 'Voß'. Assuming UTF-8