NAME

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

SYNOPSIS

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

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

DESCRIPTION

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.

ACKNOWLEDGEMENTS

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

COPYRIGHT & LICENSE

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.