1 #include "otsdaq/XmlUtilities/DOMTreeErrorReporter.h"
2 #include "otsdaq/Macros/CoutMacros.h"
3 #include "otsdaq/MessageFacility/MessageFacility.h"
7 #include <xercesc/util/XMLString.hpp>
12 #define __COUT_HDR__ "DOMTreeErrorReporter"
15 DOMTreeErrorReporter::DOMTreeErrorReporter() {}
18 DOMTreeErrorReporter::~DOMTreeErrorReporter() {}
21 void DOMTreeErrorReporter::warning(
const xercesc::SAXParseException& ex)
23 __COUT__ <<
"Warning!" << std::endl;
24 __THROW__(reportParseException(ex));
28 void DOMTreeErrorReporter::error(
const xercesc::SAXParseException& ex)
30 __COUT__ <<
"Error!" << std::endl;
31 __THROW__(reportParseException(ex));
35 void DOMTreeErrorReporter::fatalError(
const xercesc::SAXParseException& ex)
37 __COUT__ <<
"Fatal Error!" << std::endl;
38 __THROW__(reportParseException(ex));
42 void DOMTreeErrorReporter::resetErrors() {}
45 std::string DOMTreeErrorReporter::reportParseException(
const xercesc::SAXParseException& exception)
48 <<
"\tIn file \"" << xercesc::XMLString::transcode(exception.getSystemId()) <<
"\", line " << exception.getLineNumber() <<
", column "
49 << exception.getColumnNumber() << std::endl
51 << xercesc::XMLString::transcode(exception.getMessage())
54 __COUT__ <<
"\n" << ss.str() << std::endl;