Revision 485
Added by berkley about 24 years ago
src/edu/ucsb/nceas/metacat/MetaCatServlet.java | ||
---|---|---|
677 | 677 |
docid = (String)murlParams.get("docid"); //get the docid value |
678 | 678 |
conn = util.getConnection(); |
679 | 679 |
xmldoc = new DocumentImpl(conn, docid); |
680 |
|
|
681 |
//************************************************** |
|
682 |
//the style sheet handling code needs to be put here. |
|
683 |
out.println(xmldoc.toString()); |
|
684 |
//************************************************** |
|
680 |
String qformat = ((String[])params.get("qformat"))[0]; |
|
681 |
if (qformat.equals("xml")) |
|
682 |
{ |
|
683 |
// set content type and other response header fields first |
|
684 |
response.setContentType("text/xml"); |
|
685 |
xmldoc.toXml(out); |
|
686 |
//out.println(xmldoc); |
|
687 |
} |
|
688 |
else if (qformat.equals("html")) |
|
689 |
{ |
|
690 |
response.setContentType("text/html"); |
|
691 |
// Look up the document type |
|
692 |
String sourcetype = xmldoc.getDoctype(); |
|
693 |
// Transform the document to the new doctype |
|
694 |
DBTransform dbt = new DBTransform(conn); |
|
695 |
dbt.transformXMLDocument(xmldoc.toString(), sourcetype, |
|
696 |
"-//W3C//HTML//EN", out); |
|
697 |
} |
|
698 |
|
|
685 | 699 |
util.returnConnection(conn); |
686 | 700 |
} |
687 | 701 |
else |
Also available in: Unified diff
added code for getting stylized related documents