Dancer
view release on metacpan or search on metacpan
lib/Dancer/Serializer/XML.pm view on Meta::CPAN
Return 'text/xml'
=head2 CONFIG FILE
You can set XML::Simple options for serialize and deserialize in the
config file:
engines:
XMLSerializer:
serialize:
AttrIndent: 1
deserialize:
ForceArray: 1
=head1 AUTHOR
Dancer Core Developers
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by Alexis Sukrieh.
t/14_serializer/01_helpers.t view on Meta::CPAN
$data = {
task => {
type => "files",
continue => 1,
action => 123,
content => '46210660-b78f-11df-8d81-0800200c9a66',
files => { file => [2131231231] }
},
};
$xml = to_xml($data, RootName => undef, AttrIndent => 1);
like $xml, qr/\n\s+\w+="\w+">46210660-b78f-11df-8d81-0800200c9a66<files>/, 'xml attributes are indented';
# OO API
setting( 'serializer' => 'XML' );
my $s = Dancer::Serializer->engine;
isa_ok( $s, $_ ) for qw(
Dancer::Engine
Dancer::Serializer::Abstract
Dancer::Serializer::XML);
( run in 0.238 second using v1.01-cache-2.11-cpan-a5abf4f5562 )