Revision 253
Added by Matt Jones over 24 years ago
src/edu/ucsb/nceas/metacat/MetaCatServlet.java | ||
---|---|---|
553 | 553 |
valtext = docreader.readXMLDocument(docid); |
554 | 554 |
|
555 | 555 |
} catch (NullPointerException npe) { |
556 |
response.setContentType("text/html");
|
|
557 |
out.println("Error getting document ID: " + docid );
|
|
556 |
response.setContentType("text/xml");
|
|
557 |
out.println("<error>Error getting document ID: " + docid + "</error>");
|
|
558 | 558 |
} |
559 | 559 |
} |
560 | 560 |
|
561 | 561 |
try { |
562 |
DBValidate valobj = new DBValidate(saxparser,xmlcatalogfile);
|
|
562 |
DBValidate valobj = new DBValidate(saxparser,conn);
|
|
563 | 563 |
boolean valid = valobj.validateString(valtext); |
564 | 564 |
|
565 | 565 |
// set content type and other response header fields first |
566 |
response.setContentType("text/html"); |
|
567 |
out.println("<html>"); |
|
568 |
out.println("<head><link rel=\"stylesheet\" type=\"text/css\" " + |
|
569 |
"href=\"/xmltodb/rowcol.css\" /></head>"); |
|
570 |
out.println("<body class=\"emlbody\">"); |
|
571 |
|
|
572 |
if (valid) { |
|
573 |
out.println("The input XML is VALID!"); |
|
574 |
} else { |
|
575 |
out.println("The input XML is NOT VALID<br />\n<pre>\n" |
|
576 |
+ valobj.returnErrors() + "\n</pre>\n"); |
|
577 |
} |
|
578 |
out.println("</body></html>"); |
|
566 |
response.setContentType("text/xml"); |
|
567 |
out.println(valobj.returnErrors()); |
|
568 |
|
|
579 | 569 |
} catch (NullPointerException npe2) { |
580 | 570 |
// set content type and other response header fields first |
581 |
response.setContentType("text/html");
|
|
582 |
out.println("Error validating document.");
|
|
571 |
response.setContentType("text/xml");
|
|
572 |
out.println("<error>Error validating document.</error>");
|
|
583 | 573 |
} |
584 | 574 |
} |
585 | 575 |
|
... | ... | |
641 | 631 |
|
642 | 632 |
/** |
643 | 633 |
* '$Log$ |
634 |
* 'Revision 1.50 2000/06/30 23:42:33 bojilova |
|
635 |
* 'finished user auth & session tracking |
|
636 |
* ' |
|
637 |
* 'Revision 1.49 2000/06/29 23:27:08 jones |
|
638 |
* 'Fixed bug in DBEntityResolver so that it now properly delegates to |
|
639 |
* 'the system id found inthe database. |
|
640 |
* 'Changed DBValidate to use DBEntityResolver, rather than the OASIS |
|
641 |
* 'catalog, and to return validation results in XML format. |
|
642 |
* ' |
|
643 |
* 'Revision 1.48 2000/06/29 20:04:51 bojilova |
|
644 |
* 'testing login |
|
645 |
* ' |
|
644 | 646 |
* 'Revision 1.36 2000/06/28 02:36:26 jones |
645 | 647 |
* 'Added feature to now ouput COMMENTs and PIs when the document is |
646 | 648 |
* 'read from the database with DBReader. |
Also available in: Unified diff
MetaCatServlet.java