2 Catalyst::View::ContentNegotiation::XHTML - Adjusts the response
3 Content-Type header to application/xhtml+xml if the browser accepts it.
6 package Catalyst::View::TT;
9 use namespace::clean -except => 'meta';
11 extends qw/Catalyst::View::TT/;
12 with qw/Catalyst::View::ContentNegotiation::XHTML/;
17 This is a simple Role which sets the response "Content-Type" to be
18 "application/xhtml+xml" if the users browser sends an "Accept" header
19 indicating that it is willing to process that MIME type.
21 Changing the "Content-Type" to "application/xhtml+xml" causes browsers
22 to interpret the page as XML, meaning that your markup must be well
26 This is useful when you're developing your application, as you know that
27 all pages you view are parsed as XML, so any errors caused by your
28 markup not being well-formed will show up at once.
30 Whilst this module is has been tested against most popular browsers
31 including Internet Explorer, it may cause unexpected results on browsers
32 which do not properly support the "application/xhtml+xml" MIME type.
36 Changes the response "Content-Type" if appropriate (from the requests
41 Some browsers (such as Internet Explorer) have a nasty way of sending
42 Accept */* and this claiming to support XHTML just as well as HTML.
43 Saving to a file on disk or opening with another application does count
44 as accepting, but it really should have a lower q value then text/html.
45 This sub takes a pragmatic approach and corrects this mistake by
46 modifying the Accept header before passing it to content negotiation.
50 Returns an array ref of 3 part arrays, comprising name, priority, output
51 mime-type, which is used for the content negotiation algorithm.
55 Returns the default variant attribute contents.
58 Catalyst::View::TT::XHTML - Trivial Catalyst TT view using this role.
59 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html> - Content
63 Should be split into a base ContentNegotiation role which is consumed by
64 ContentNegotiation::XHTML.
67 Maintainer and contributor of various features - David Dorward "<david@dorward.me.uk>"
69 Original author - Tomas Doran (t0m) "<bobtfish@bobtfish.net>"
73 Florian Ragwitz (rafl) "<rafl@debian.org>" - Conversion into a Moose
74 Role, which is what the module should have been originally.
77 This module itself is copyright (c) 2008 Tomas Doran and is licensed
78 under the same terms as Perl itself.