-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSAXErrorHandler.cpp
46 lines (40 loc) · 1.51 KB
/
SAXErrorHandler.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "stdafx.h"
#include <xercesc/sax/SAXParseException.hpp>
#include "SAXErrorHandler.hpp"
//#if defined(XERCES_NEW_IOSTREAMS)
//#include <iostream>
//#else
//#include <iostream.h>
//#endif
//#include <stdlib.h>
//#include <string.h>
void SAXErrorHandler::warning(const SAXParseException&)
{
//
// Ignore all warnings.
//
}
void SAXErrorHandler::error(const SAXParseException& toCatch)
{
fSawErrors = true;
_tprintf(_T("Error at file \"%s\", line %d, column %d\n Message: %s\n"), toCatch.getSystemId(),
toCatch.getLineNumber(), toCatch.getColumnNumber(), toCatch.getMessage());
// XERCES_STD_QUALIFIER cerr << "Error at file \"" << StrX(toCatch.getSystemId())
// << "\", line " << toCatch.getLineNumber()
// << ", column " << toCatch.getColumnNumber()
// << "\n Message: " << StrX(toCatch.getMessage()) << XERCES_STD_QUALIFIER endl;
}
void SAXErrorHandler::fatalError(const SAXParseException& toCatch)
{
fSawErrors = true;
_tprintf(_T("Fatal Error at file \"%s\", line %d, column %d\n Message: %s\n"), toCatch.getSystemId(),
toCatch.getLineNumber(), toCatch.getColumnNumber(), toCatch.getMessage());
// XERCES_STD_QUALIFIER cerr << "Fatal Error at file \"" << StrX(toCatch.getSystemId())
// << "\", line " << toCatch.getLineNumber()
// << ", column " << toCatch.getColumnNumber()
// << "\n Message: " << StrX(toCatch.getMessage()) << XERCES_STD_QUALIFIER endl;
}
void SAXErrorHandler::resetErrors()
{
fSawErrors = false;
}