package DTA::Controller::Util;
use Moose;
use namespace::autoclean;

BEGIN {extends 'Catalyst::Controller'; }

use DTA::XMLsh;

=head1 NAME

DTA::Controller::Util - Catalyst Controller

=head1 DESCRIPTION

Catalyst Controller.

=head1 METHODS

=head2 xmlsh

=cut

sub xmlsh : Local {
    my ( $self, $c ) = @_;
    my $code = $c->req->params->{code};
    for ( $code ) {
        s/&lt;/</g;
        s/&gt;/>/g;
        s/&amp;/&/g;
    }
    $c->res->content_type( 'text/html; charset=utf-8' );
    $c->res->body( DTA::XMLsh::highlight_xml( $code ) );
}

__PACKAGE__->meta->make_immutable;

1;
__END__

=head1 AUTHOR

Frank Wiegand

=head1 LICENSE

This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.

=cut
