diff --git a/samples/DOMPrint/DOMPrintErrorHandler.cpp b/samples/DOMPrint/DOMPrintErrorHandler.cpp index 484f1cd1fa1f25cdd8dafc8158b646c09e01b505..23c6694367843267502bb915dc4058a69a9e6837 100644 --- a/samples/DOMPrint/DOMPrintErrorHandler.cpp +++ b/samples/DOMPrint/DOMPrintErrorHandler.cpp @@ -57,6 +57,9 @@ /* * $Id$ * $Log$ + * Revision 1.2 2002/06/11 19:46:28 peiyongz + * Display error message received from the serializer. + * * Revision 1.1 2002/05/29 21:19:50 peiyongz * DOM3 DOMWriter/DOMWriterFilter * @@ -65,10 +68,18 @@ #include "DOMPrintErrorHandler.hpp" +#include <iostream.h> +#include <xercesc/dom/impl/DOMErrorImpl.hpp> +#include <xercesc/util/XMLString.hpp> + bool DOMPrintErrorHandler::handleError(const DOMError &domError) { - // hummm, I will leave it to the serializer if the - // serialization shall be aborted or not. - return true; + // Display whatever error message passed from the serializer + char *msg = XMLString::transcode(((DOMErrorImpl&)domError).getMessage()); + cout<<msg<<endl; + delete[] msg; + + // Instructs the serializer to continue serialization if possible. + return true; }