source: icXML/icXML-devel/samples/src/DOMPrint/DOMTreeErrorReporter.cpp @ 2726

Last change on this file since 2726 was 2726, checked in by cameron, 7 years ago

Add original Xerces tests and samples directories

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