<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt">Thanks Jay.<br><br>I thought of that solution too when I had a look at Catalyst::Plugin::Static::Simple. But in this case, my doubt was, and is, how should I create the view through the helper?<br>Most of the examples for creating views are TT views, so they create it as 'script/hello_create.pl view my_TT_view TT'.<div> </div>David<div><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">De:</span></b> J. Shirley <jshirley@gmail.com><br><b><span style="font-weight: bold;">Para:</span></b> The elegant MVC web framework <catalyst@lists.scsys.co.uk><br><b><span style="font-weight:
bold;">Enviado:</span></b> vie,5 marzo, 2010 16:45<br><b><span style="font-weight: bold;">Asunto:</span></b> Re: [Catalyst] Best practices: XML output from static XML<br></font><br>On Fri, Mar 5, 2010 at 5:10 AM, David <<a ymailto="mailto:oldskiffle@yahoo.es" href="mailto:oldskiffle@yahoo.es">oldskiffle@yahoo.es</a>> wrote:<br>> Hi,<br>><br>> I need to generate an XML output (Content-type: application/xml), but this<br>> XML output is the XML content which is stored in an XML file. I don't need<br>> to dinamically generate this XML content.<br>> I have searched in google but I don't find any catalyst view module for<br>> managing this case. I don't know if exists any module for generating XML<br>> output from a static file as, for example, Catalyst::View::XSLT module<br>> (<a href="http://search.cpan.org/%7Ejanus/Catalyst-View-XSLT-0.08/lib/Catalyst/View/XSLT.pm"
target="_blank">http://search.cpan.org/~janus/Catalyst-View-XSLT-0.08/lib/Catalyst/View/XSLT.pm</a>)<br>> does. That is, generate an output from a static file, in this case, an XML<br>> output.<br>><br>> I am not finding much information about designing your own views in<br>> Catalyst, or at least, I don't see much flexibility. All examples I have<br>> found need to be generated, through the helper view, with TT template or any<br>> other templates.<br>> Is it possible to create your own view, with no template, and for example,<br>> in my case, read the output from a static file and send this output to the<br>> client? (I don't know exactly how Views works in Catalyst, though I have<br>> already read Catalyst tutorial and cookbook)<br>><br>> Thanks in advanced,<br>><br>><br>> David<br>><br><br><br>Well, you could do your own view or just rely on<br>Catalyst::Plugin::Static::Simple:<br><br><a
href="http://search.cpan.org/%7Emstrout/Catalyst-Plugin-Static-Simple-0.29/lib/Catalyst/Plugin/Static/Simple.pm#serve_static_file_$file_path" target="_blank">http://search.cpan.org/~mstrout/Catalyst-Plugin-Static-Simple-0.29/lib/Catalyst/Plugin/Static/Simple.pm#serve_static_file_$file_path</a><br><br>You could wrap this in a view:<br><br>package MyApp::View::StaticFile;<br><br>use parent 'Catalyst::View';<br><br>sub process {<br> my ( $self, $c ) = @_;<br> $c->serve_static_file( $c->stash->{static_file} );<br>}<br><br>1;<br><br><br><br>Then just do $c->forward( $c->view('StaticFile') ); after setting the stash key.<br><br>-Jay<br><br>_______________________________________________<br>List: <a ymailto="mailto:Catalyst@lists.scsys.co.uk" href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst"
target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br></div></div>
</div><br>
</body></html>