}
sub output_html_with_http_headers {
binmode( STDOUT, ":encoding(utf8)" );
my ( $query, $cookie, $data, $status ) = @_;
$data =~ s/\&\;amp\; /\&\; /g && warn "DEBUG: fix double &";
utf8::encode($data);
output_with_http_headers( $query, $cookie, $data, 'html', $status );
$stylesheet->{$xslfilename} = $xslt->parse_stylesheet($style_doc);
my $results = $stylesheet->{$xslfilename}->transform($source);
my $newxmlrecord = $stylesheet->{$xslfilename}->output_string($results);
my $newxmlrecord = $stylesheet->{$xslfilename}->output_as_chars($results);
#utf8::decode($newxmlrecord); # Bug 6554 - XSLT templates have utf-8 in header
return $newxmlrecord;
-