dbertoni    02/04/01 22:15:07

  Modified:    c/src/XalanTransformer XalanTransformer.cpp
                        XalanTransformer.hpp
  Log:
  Added new implementation for reporting messages and warnings.
  
  Revision  Changes    Path
  1.46      +14 -3     xml-xalan/c/src/XalanTransformer/XalanTransformer.cpp
  
  Index: XalanTransformer.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XalanTransformer.cpp,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- XalanTransformer.cpp      28 Mar 2002 07:08:47 -0000      1.45
  +++ XalanTransformer.cpp      2 Apr 2002 06:15:07 -0000       1.46
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -59,6 +59,11 @@
   
   
   #include <algorithm>
  +#if defined(XALAN_OLD_STREAM_HEADERS)
  +#include <iostream.h>
  +#else
  +#include <iostream>
  +#endif
   
   
   
  @@ -112,6 +117,7 @@
   #include "XalanDefaultDocumentBuilder.hpp"
   #include "XalanDefaultParsedSource.hpp"
   #include "XalanTransformerOutputStream.hpp"
  +#include "XalanTransformerProblemListener.hpp"
   #include "XercesDOMParsedSource.hpp"
   
   
  @@ -135,6 +141,11 @@
        m_entityResolver(0),
        m_errorHandler(0),
        m_problemListener(0),
  +#if defined(XALAN_NO_NAMESPACES)
  +     m_warningStream(&cerr),
  +#else
  +     m_warningStream(&std::cerr),
  +#endif
        m_stylesheetExecutionContext(new StylesheetExecutionContextDefault)
   {
   #if defined(XALAN_USE_ICU)
  @@ -489,7 +500,7 @@
                // Create a problem listener and send output to a XalanDOMString.
                DOMStringPrintWriter    thePrintWriter(theErrorMessage);
   
  -             ProblemListenerDefault  theProblemListener(&thePrintWriter);
  +             XalanTransformerProblemListener         
theProblemListener(m_warningStream, &thePrintWriter);
   
                if (m_problemListener == 0)
                {
  @@ -1005,7 +1016,7 @@
                // pushing params, since there could be a problem resolving a QName.
                DOMStringPrintWriter    thePrintWriter(theErrorMessage);
   
  -             ProblemListenerDefault  theProblemListener(&thePrintWriter);
  +             XalanTransformerProblemListener         
theProblemListener(m_warningStream, &thePrintWriter);
   
                if (m_problemListener == 0)
                {
  
  
  
  1.38      +37 -0     xml-xalan/c/src/XalanTransformer/XalanTransformer.hpp
  
  Index: XalanTransformer.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XalanTransformer.hpp,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- XalanTransformer.hpp      8 Feb 2002 00:24:56 -0000       1.37
  +++ XalanTransformer.hpp      2 Apr 2002 06:15:07 -0000       1.38
  @@ -67,6 +67,12 @@
   #include <cassert>
   #include <vector>
   
  +#if defined(XALAN_OLD_STREAMS)
  +class ostream;
  +#else
  +#include <iosfwd>
  +#endif
  +
   
   
   #include <XPath/XalanQNameByValue.hpp>
  @@ -102,6 +108,12 @@
   {
   public:
        
  +#if defined(XALAN_NO_NAMESPACES)
  +     typedef ostream                 StreamType;
  +#else
  +     typedef std::ostream    StreamType;
  +#endif
  +
        XalanTransformer();
   
        virtual
  @@ -585,6 +597,29 @@
        void
        setIndent(int   indentAmount);
   
  +     /**
  +      * Set the ostream instance for reporting warnings and messages.  The default
  +      * is std::cerr.  If set to null, no warnings or messages will be written.
  +      * 
  +      * @param theStream A pointer to the ostream instance.
  +      */
  +     void
  +     setWarningStream(StreamType*    theStream)
  +     {
  +             m_warningStream = theStream;
  +     }
  +
  +     /**
  +      * Get the current warning stream ostream instance
  +      *
  +      * @return A pointer to the instance.  Can be null.
  +      */
  +     StreamType*
  +     getWarningStream() const
  +     {
  +             return m_warningStream;
  +     }
  +
   #if defined(XALAN_NO_NAMESPACES)
        typedef vector<const XalanCompiledStylesheet*>          
CompiledStylesheetPtrVectorType;
        typedef vector<const XalanParsedSource*>                        
ParsedSourcePtrVectorType;
  @@ -724,6 +759,8 @@
        ErrorHandler*                                                   m_errorHandler;
   
        ProblemListener*                                                
m_problemListener;
  +
  +     StreamType*                                                             
m_warningStream;
   
        // This should always be the latest data member!!!
        StylesheetExecutionContextDefault*              m_stylesheetExecutionContext;
  
  
  

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

Reply via email to