The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.


MojoX::Fixup::XHTML - serves application/xhtml+xml content for Mojo


    package MyApp;
    use base 'Mojolicious';
    use MojoX::Fixup::XHTML;
    use MRO::Compat;

    # This method will run for each request
    sub dispatch {
        my ($self, $c) = @_;
        MojoX::Fixup::XHTML->fix_xhtml( $c );


This sets the response Content-Type to be application/xhtml+xml if the user's browser sends an Accept header indicating that it is willing to process that MIME type.

Changing the Content-Type causes browsers to interpret the page as strict XHTML, meaning that the markup must be well formed.

This is useful when you're developing your application, as you know that all pages you view are rendered strictly, so any markup errors will show up at once.


Tomas Doran - Catalyst::View::TT::XHTML, most of the code are copied from there


Copyright 2008-2009 Fayland Lam, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.