// file : xsd/cxx/xml/sax/bits/error-handler-proxy.txx // author : Boris Kolpackov // copyright : Copyright (c) 2005-2009 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file #include namespace xsd { namespace cxx { namespace xml { namespace sax { namespace bits { template void error_handler_proxy:: warning (const xercesc::SAXParseException& e) { if (native_eh_) native_eh_->warning (e); else handle (e, severity::warning); } template void error_handler_proxy:: error (const xercesc::SAXParseException& e) { failed_ = true; if (native_eh_) native_eh_->error (e); else handle (e, severity::error); } template void error_handler_proxy:: fatalError (const xercesc::SAXParseException& e) { failed_ = true; if (native_eh_) native_eh_->fatalError (e); else handle (e, severity::fatal); } template void error_handler_proxy:: handle (const xercesc::SAXParseException& e, severity s) { //@@ I do not honor return values from the handler. This // is not too bad at the moment because I set // all-errors-are-fatal flag on the parser. // const XMLCh* id (e.getPublicId ()); if (id == 0) id = e.getSystemId (); #if _XERCES_VERSION >= 30000 eh_->handle (transcode (id), static_cast (e.getLineNumber ()), static_cast (e.getColumnNumber ()), s, transcode (e.getMessage ())); #else XMLSSize_t l (e.getLineNumber ()); XMLSSize_t c (e.getColumnNumber ()); eh_->handle (transcode (id), (l == -1 ? 0 : static_cast (l)), (c == -1 ? 0 : static_cast (c)), s, transcode (e.getMessage ())); #endif } } } } } }