$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include "otsdaq-core/XmlUtilities/DOMTreeErrorReporter.h" 00002 #include "otsdaq-core/Macros/CoutMacros.h" 00003 #include "otsdaq-core/MessageFacility/MessageFacility.h" 00004 00005 #include <iostream> 00006 #include <sstream> 00007 #include <xercesc/util/XMLString.hpp> 00008 00009 using namespace ots; 00010 00011 #undef __COUT_HDR__ 00012 #define __COUT_HDR__ "DOMTreeErrorReporter" 00013 00014 //============================================================================== 00015 DOMTreeErrorReporter::DOMTreeErrorReporter() {} 00016 00017 //============================================================================== 00018 DOMTreeErrorReporter::~DOMTreeErrorReporter() {} 00019 00020 //============================================================================== 00021 void DOMTreeErrorReporter::warning(const xercesc::SAXParseException& ex) 00022 { 00023 __COUT__ << "Warning!" << std::endl; 00024 __THROW__(reportParseException(ex)); 00025 } 00026 00027 //============================================================================== 00028 void DOMTreeErrorReporter::error(const xercesc::SAXParseException& ex) 00029 { 00030 __COUT__ << "Error!" << std::endl; 00031 __THROW__(reportParseException(ex)); 00032 } 00033 00034 //============================================================================== 00035 void DOMTreeErrorReporter::fatalError(const xercesc::SAXParseException& ex) 00036 { 00037 __COUT__ << "Fatal Error!" << std::endl; 00038 __THROW__(reportParseException(ex)); 00039 } 00040 00041 //============================================================================== 00042 void DOMTreeErrorReporter::resetErrors() {} 00043 00044 //============================================================================== 00045 std::string DOMTreeErrorReporter::reportParseException( 00046 const xercesc::SAXParseException& exception) 00047 { 00048 __SS__ 00049 << "\n" 00050 << "\tIn file \"" << xercesc::XMLString::transcode(exception.getSystemId()) 00051 << "\", line " << exception.getLineNumber() << ", column " 00052 << exception.getColumnNumber() << std::endl 00053 << "\tMessage: " 00054 << xercesc::XMLString::transcode(exception.getMessage()) 00055 //<< " (check against xsd file)" //RAR commented, has no meaning to me or users.. 00056 << "\n\n"; 00057 __COUT__ << "\n" << ss.str() << std::endl; 00058 return ss.str(); 00059 }