+if($view eq 'card' || $view eq 'html') {
+ my $xml = $importid ? $record->as_xml(): GetXmlBiblio($biblionumber);
+ my $xsl;
+ if ( $view eq 'card' ){
+ $xsl = C4::Context->preference('marcflavour') eq 'UNIMARC'
+ ? 'UNIMARC_compact.xsl' : 'compact.xsl';
+ }
+ else {
+ $xsl = 'plainMARC.xsl';
+ }
+ my $htdocs = C4::Context->config('intrahtdocs');
+ my ($theme, $lang) = C4::Templates::themelanguage($htdocs, $xsl, 'intranet', $input);
+ $xsl = "$htdocs/$theme/$lang/xslt/$xsl";
+ print $input->header(-charset => 'UTF-8'),
+ Encode::encode_utf8(C4::XSLT::engine->transform($xml, $xsl));
+}
+else {
+ $template->param( MARC_FORMATTED => $record->as_formatted );
+ output_html_with_http_headers $input, $cookie, $template->output;