1 package Catalyst::Action::Serialize::XML::Simple;
4 use namespace::autoclean;
6 extends 'Catalyst::Action';
9 $VERSION = eval $VERSION;
13 my ( $controller, $c ) = @_;
19 $c->log->debug("Could not load XML::Serializer, refusing to serialize: $@")
23 my $xs = XML::Simple->new(ForceArray => 0,);
26 $controller->{'serialize'} ?
27 $controller->{'serialize'}->{'stash_key'} :
28 $controller->{'stash_key'}
30 my $output = $xs->XMLout({ data => $c->stash->{$stash_key} });
31 $c->response->output( $output );
35 __PACKAGE__->meta->make_immutable;