NAME
Catmandu::Importer::XML - Import serialized XML documents
VERSION
version 0.01
DESCRIPTION
This importer reads XML and transforms it into a data structure. Two types of structure can be choosen among:
- simple (default)
-
Elements and attributes and converted to keys in a key-value structure. For instance
<doc attr="value"> <field1>foo</field1> <field1>bar</field1> <bar> <doz>baz</doz> </bar> </doc>
is imported as
{ attr => 'value', field1 => [ 'foo', 'bar' ], field2 => { 'doz' => 'baz' }, }
- ordered
-
Elements are preserved in the order of their appereance. For instance the sample document above is imported as:
[ doc => { attr => "value" }, [ [ field1 => { }, ["foo"] ], [ field1 => { }, ["bar"] ], [ field2 => { }, [ [ doz => { }, ["baz"] ] ] ] ] ]
Attributes can be omitted with option
attributes
.
CONFIGURATION
- attributes
- path
- root
- whitespace
SEE ALSO
This module is just a thin layer on top of XML::Struct::Reader.
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.