Change author information
[catagits/Catalyst-View-ContentNegotiation-XHTML.git] / README
1 NAME
2     Catalyst::View::ContentNegotiation::XHTML - Adjusts the response
3     Content-Type header to application/xhtml+xml if the browser accepts it.
4
5 SYNOPSIS
6         package Catalyst::View::TT;
7
8         use Moose;
9         use namespace::clean -except => 'meta';
10
11         extends qw/Catalyst::View::TT/;
12         with qw/Catalyst::View::ContentNegotiation::XHTML/;
13
14         1;
15
16 DESCRIPTION
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.
20
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
23     formed.
24
25 CAVEATS
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.
29
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.
33
34 METHOD MODIFIERS
35   after process
36     Changes the response "Content-Type" if appropriate (from the requests
37     "Accept" header).
38
39 METHODS
40   pragmatic_accept
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.
47
48 ATTRIBUTES
49   variants
50     Returns an array ref of 3 part arrays, comprising name, priority, output
51     mime-type, which is used for the content negotiation algorithm.
52
53 PRIVATE METHODS
54   _build_variants
55     Returns the default variant attribute contents.
56
57 SEE ALSO
58     Catalyst::View::TT::XHTML - Trivial Catalyst TT view using this role.
59     <http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html> - Content
60     negotiation RFC.
61
62 BUGS
63     Should be split into a base ContentNegotiation role which is consumed by
64     ContentNegotiation::XHTML.
65
66 AUTHOR
67     Maintainer and contributor of various features - David Dorward "<david@dorward.me.uk>"
68
69     Original author - Tomas Doran (t0m) "<bobtfish@bobtfish.net>"
70
71 CONTRIBUTORS
72
73     Florian Ragwitz (rafl) "<rafl@debian.org>" - Conversion into a Moose
74     Role, which is what the module should have been originally.
75
76 COPYRIGHT
77     This module itself is copyright (c) 2008 Tomas Doran and is licensed
78     under the same terms as Perl itself.
79