[Catalyst] Can Catalyst-Plugin-AtomServer support nontext/xhtml content?

Jonathan Rockway jon at jrock.us
Mon Sep 25 17:28:18 CEST 2006

XML::Atom is for Atom ("RSS") feeds.  If you have non-Atom tags in your
XML, I think the feed server assumes it's some variant of XHTML instead.
 What is the xmlns on the <div> tags?

Here's how you're "supposed" to use C::P::AtomServer:


Also, Atom's mime type is application/atom+xml (not the others you
tried), so that might mean something.

But if your XML isn't Atom, I'm not sure why you're using
C::P::AtomServer.  More information about what you're trying to achieve
would be appreciated.  I see no problem with:

sub serve_xml : ... {
   my ($self, $c, @args) = @_;
   $c->response->body( XMLOut( [hash to xml encode] );

if all you want to do is spew some XML to the client.

Jonathan Rockway

John Napiorkowski wrote:
> Hi,
> I'm using the Catalyst-Plugin-AtomServer as a way to
> expose some xml encoded data but having trouble
> getting the plugin to accept a content type of 'xml'. 
> I can do:
> use XML::Simple;
> my $content = XML::Atom::Content;
> $content->type('application/xml')
> $content->body( XMLOut( [hash to xml encode] );
> and then add the content object to the entry object
> but I still get output that wraps the XML in an xhtml
> div tag.  The content type attribute does get set
> correctly though and I do get the xml content inside
> the content tags, just it has the extra div tag which
> messes up my clients on the other side.  I've tried
> 'application/xml', 'xml', 'text/xml', etc. but none of
> these seem to work.
> Has anyone gotten this to work with this plugin or
> found a different way to accomplsih this task?  Advice
> appreciated.

More information about the Catalyst mailing list