1 | /*
|
---|
2 | * Copyright 1999-2002,2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*
|
---|
18 | * $Id: DOMTreeErrorReporter.cpp,v 1.14 2004/09/08 13:55:31 peiyongz Exp $
|
---|
19 | */
|
---|
20 |
|
---|
21 | // ---------------------------------------------------------------------------
|
---|
22 | // Includes
|
---|
23 | // ---------------------------------------------------------------------------
|
---|
24 | #include <xercesc/sax/SAXParseException.hpp>
|
---|
25 | #include "DOMTreeErrorReporter.hpp"
|
---|
26 | #if defined(XERCES_NEW_IOSTREAMS)
|
---|
27 | #include <iostream>
|
---|
28 | #else
|
---|
29 | #include <iostream.h>
|
---|
30 | #endif
|
---|
31 | #include <stdlib.h>
|
---|
32 | #include <string.h>
|
---|
33 |
|
---|
34 |
|
---|
35 | void DOMTreeErrorReporter::warning(const SAXParseException&)
|
---|
36 | {
|
---|
37 | //
|
---|
38 | // Ignore all warnings.
|
---|
39 | //
|
---|
40 | }
|
---|
41 |
|
---|
42 | void DOMTreeErrorReporter::error(const SAXParseException& toCatch)
|
---|
43 | {
|
---|
44 | fSawErrors = true;
|
---|
45 | XERCES_STD_QUALIFIER cerr << "Error at file \"" << StrX(toCatch.getSystemId())
|
---|
46 | << "\", line " << toCatch.getLineNumber()
|
---|
47 | << ", column " << toCatch.getColumnNumber()
|
---|
48 | << "\n Message: " << StrX(toCatch.getMessage()) << XERCES_STD_QUALIFIER endl;
|
---|
49 | }
|
---|
50 |
|
---|
51 | void DOMTreeErrorReporter::fatalError(const SAXParseException& toCatch)
|
---|
52 | {
|
---|
53 | fSawErrors = true;
|
---|
54 | XERCES_STD_QUALIFIER cerr << "Fatal Error at file \"" << StrX(toCatch.getSystemId())
|
---|
55 | << "\", line " << toCatch.getLineNumber()
|
---|
56 | << ", column " << toCatch.getColumnNumber()
|
---|
57 | << "\n Message: " << StrX(toCatch.getMessage()) << XERCES_STD_QUALIFIER endl;
|
---|
58 | }
|
---|
59 |
|
---|
60 | void DOMTreeErrorReporter::resetErrors()
|
---|
61 | {
|
---|
62 | fSawErrors = false;
|
---|
63 | }
|
---|
64 |
|
---|
65 |
|
---|