Project

General

Profile

« Previous | Next » 

Revision 383

Fixed small bug in transforming the document to HTML. If there was
no stylesheet for a given doctype, and so the transformation couldn't
occur, the XML doc was returned, but the content-type was still set
(incorrectly) to html. Now it is not set to text/html when an xml doc is
sent.

View differences:

src/edu/ucsb/nceas/metacat/MetaCatServlet.java
593 593
        response.setContentType("text/xml");
594 594
        out.println(doc);
595 595
      } else if (qformat.equals("html")) {
596
        // set content type and other response header fields first
597
        response.setContentType("text/html");
598 596

  
599 597
        // Look up the document type
600 598
        String sourcetype = docreader.getDoctypeInfo(docid).getDoctype();
......
602 600
        // Transform the document to the new doctype
603 601
        dbt.transformXMLDocument(doc, sourcetype, "-//W3C//HTML//EN", out);
604 602
      }
605
    //} catch (NullPointerException npe) {
606
      //response.setContentType("text/html");
607
      //out.println("Error getting document ID: " + docidstr +" (" + docid + ")");
608 603
    } catch (McdbException e) {
609 604
      response.setContentType("text/xml");
610 605
      e.toXml(out);

Also available in: Unified diff