tng         2002/12/10 07:36:36

  Modified:    c/samples/DOMPrint DOMPrintErrorHandler.cpp
  Log:
  DOMPrint minor update: print error message to cerr.
  
  Revision  Changes    Path
  1.4       +28 -18    xml-xerces/c/samples/DOMPrint/DOMPrintErrorHandler.cpp
  
  Index: DOMPrintErrorHandler.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/DOMPrint/DOMPrintErrorHandler.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DOMPrintErrorHandler.cpp  13 Jun 2002 14:55:01 -0000      1.3
  +++ DOMPrintErrorHandler.cpp  10 Dec 2002 15:36:36 -0000      1.4
  @@ -1,37 +1,37 @@
   /*
    * The Apache Software License, Version 1.1
  - * 
  + *
    * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
  - * 
  + *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
  - * 
  + *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  - * 
  + *    notice, this list of conditions and the following disclaimer.
  + *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
  - * 
  + *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
    *    if and wherever such third-party acknowledgments normally appear.
  - * 
  + *
    * 4. The names "Xerces" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache\@apache.org.
  - * 
  + *
    * 5. Products derived from this software may not be called "Apache",
    *    nor may "Apache" appear in their name, without prior written
    *    permission of the Apache Software Foundation.
  - * 
  + *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  @@ -45,7 +45,7 @@
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
  - * 
  + *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation, and was
    * originally based on software copyright (c) 1999, International
  @@ -54,9 +54,12 @@
    * <http://www.apache.org/>.
    */
   
  -/* 
  +/*
    * $Id$
    * $Log$
  + * Revision 1.4  2002/12/10 15:36:36  tng
  + * DOMPrint minor update: print error message to cerr.
  + *
    * Revision 1.3  2002/06/13 14:55:01  peiyongz
    * Fix to UNIX compilation failure
    *
  @@ -69,17 +72,24 @@
    *
    */
   
  -#include "DOMPrintErrorHandler.hpp"
  -
   #include <iostream.h>
  -#include <xercesc/dom/DOMError.hpp>
   #include <xercesc/util/XMLString.hpp>
  +#include <xercesc/dom/DOMError.hpp>
  +
  +#include "DOMPrintErrorHandler.hpp"
   
   bool DOMPrintErrorHandler::handleError(const DOMError &domError)
   {
       // Display whatever error message passed from the serializer
  +    if (domError.getSeverity() == DOMError::DOM_SEVERITY_WARNING)
  +        cerr << "\nWarning Message: ";
  +    else if (domError.getSeverity() == DOMError::DOM_SEVERITY_ERROR)
  +        cerr << "\nError Message: ";
  +    else
  +        cerr << "\nFatal Message: ";
  +
       char *msg = XMLString::transcode(domError.getMessage());
  -    cout<<msg<<endl;
  +    cerr<< msg <<endl;
       delete[] msg;
   
       // Instructs the serializer to continue serialization if possible.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to