| CatalystX-Usul documentation | Contained in the CatalystX-Usul distribution. |
CatalystX::Usul::View::XML - Render XML response to an XMLHttpRequest
0.3.$Revision: 576 $
MyApp->config( "View::XML" => {
base_class => qw(CatalystX::Usul::View::XML) } );
The XML view is used to generate fragments of XML in response to Javascript XMLHttpRequests from a client that has selected this as the required content type
Deserializes the supplied data
Returns the supplied data encoded as XML
None
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Peter Flanigan, <Support at RoxSoft.co.uk>
Copyright (c) 2008 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
| CatalystX-Usul documentation | Contained in the CatalystX-Usul distribution. |
# @(#)$Id: XML.pm 576 2009-06-09 23:23:46Z pjf $ package CatalystX::Usul::View::XML; use strict; use warnings; use version; our $VERSION = qv( sprintf '0.3.%d', q$Rev: 576 $ =~ /\d+/gmx ); use parent qw(CatalystX::Usul::View); use Class::C3; use XML::Simple; __PACKAGE__->config( deserialize_attrs => { ForceArray => 0 } ); sub deserialize { my ($self, @rest) = @_; my $process; $process = sub { return XML::Simple->new( %{ $_[0] } )->xml_in( $_[1] ); }; return $self->next::method( @rest, $process ); } sub serialize { my ($self, $attrs, $data) = @_; return XML::Simple->new( %{ $attrs } )->xml_out( $data ); } 1; __END__
# Local Variables: # mode: perl # tab-width: 3 # End: