dbertoni    02/04/03 22:21:10

  Modified:    c/src/XSLT ProblemListenerDefault.cpp
                        ProblemListenerDefault.hpp
  Log:
  Made error formatting member function static for general use.
  
  Revision  Changes    Path
  1.8       +69 -58    xml-xalan/c/src/XSLT/ProblemListenerDefault.cpp
  
  Index: ProblemListenerDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ProblemListenerDefault.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ProblemListenerDefault.cpp        6 Feb 2002 20:49:53 -0000       1.7
  +++ ProblemListenerDefault.cpp        4 Apr 2002 06:21:10 -0000       1.8
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -131,64 +131,75 @@
   {
        if (m_pw != 0)
        {
  -             if (eXMLPARSER == where)
  -             {
  -                     m_pw->print(xmlHeader);
  -             }
  -             else if (eXPATH == where)
  -             {
  -                     m_pw->print(xpathHeader);
  -             }
  -             else
  -             {
  -                     m_pw->print(xslHeader);
  -             }
  -
  -             if (eERROR == classification)
  -             {
  -                     m_pw->print(errorHeader);
  -             }
  -             else
  -             {
  -                     m_pw->print(warningHeader);
  -             }
  -
  -             m_pw->print(msg);
  -
  -             if (0 != styleNode)
  -             {
  -                     m_pw->print(styleTreeNodeHeader);
  -                     m_pw->print(styleNode->getNodeName());
  -             }
  -
  -             if (0 != sourceNode)
  -             {
  -                     m_pw->print(sourceTreeNodeHeader);
  -                     m_pw->print(sourceNode->getNodeName());
  -             }
  -
  -             m_pw->print(locationOpen);
  -
  -             if (0 != uri)
  -             {
  -                     m_pw->print(uriHeader);
  -                     m_pw->print(uri);
  -             }
  -
  -             if (0 != lineNo)
  -             {
  -                     m_pw->print(lineNoHeader);
  -                     m_pw->print(lineNo);
  -             }
  -
  -             if (0 != charOffset)
  -             {
  -                     m_pw->print(charOffsetHeader);
  -                     m_pw->print(charOffset);
  -             }
  +             problem(*m_pw, where, classification, sourceNode, styleNode, 
msg, uri, lineNo, charOffset);
  +     }
  +}
  +
   
  -             m_pw->print(locationClose);
   
  -             m_pw->println();
  +void
  +ProblemListenerDefault::problem(
  +                     PrintWriter&                    pw,
  +                     eProblemSource                  where,
  +                     eClassification                 classification, 
  +                     const XalanNode*                sourceNode,
  +                     const XalanNode*                styleNode,
  +                     const XalanDOMString&   msg,
  +                     const XalanDOMChar*             uri,
  +                     int                                             lineNo,
  +                     int                                             
charOffset)
  +{
  +     if (eXMLPARSER == where)
  +     {
  +             pw.print(xmlHeader);
        }
  +     else if (eXPATH == where)
  +     {
  +             pw.print(xpathHeader);
  +     }
  +     else
  +     {
  +             pw.print(xslHeader);
  +     }
  +
  +     if (eERROR == classification)
  +     {
  +             pw.print(errorHeader);
  +     }
  +     else
  +     {
  +             pw.print(warningHeader);
  +     }
  +
  +     pw.print(msg);
  +
  +     if (0 != styleNode)
  +     {
  +             pw.print(styleTreeNodeHeader);
  +             pw.print(styleNode->getNodeName());
  +     }
  +
  +     if (0 != sourceNode)
  +     {
  +             pw.print(sourceTreeNodeHeader);
  +             pw.print(sourceNode->getNodeName());
  +     }
  +
  +     pw.print(locationOpen);
  +
  +     if (0 != uri)
  +     {
  +             pw.print(uriHeader);
  +             pw.print(uri);
  +     }
  +
  +     pw.print(lineNoHeader);
  +     pw.print(lineNo);
  +
  +     pw.print(charOffsetHeader);
  +     pw.print(charOffset);
  +
  +     pw.print(locationClose);
  +
  +     pw.println();
   }
  
  
  
  1.6       +13 -7     xml-xalan/c/src/XSLT/ProblemListenerDefault.hpp
  
  Index: ProblemListenerDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ProblemListenerDefault.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ProblemListenerDefault.hpp        2 Apr 2002 05:37:55 -0000       1.5
  +++ ProblemListenerDefault.hpp        4 Apr 2002 06:21:10 -0000       1.6
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -57,12 +57,6 @@
   #if !defined(XALAN_PROBLEMLISTENERDEFAULT_HEADER_GUARD)
   #define XALAN_PROBLEMLISTENERDEFAULT_HEADER_GUARD
   
  -/**
  - * $State: Exp $
  - * 
  - * @author Scott Boag ([EMAIL PROTECTED])
  - * */
  -
   
   
   // Base include file.  Must be first.
  @@ -110,6 +104,18 @@
        {
                return m_pw;
        }
  +
  +     static void
  +     problem(
  +                     PrintWriter&                    pw,
  +                     eProblemSource                  where,
  +                     eClassification                 classification, 
  +                     const XalanNode*                sourceNode,
  +                     const XalanNode*                styleNode,
  +                     const XalanDOMString&   msg,
  +                     const XalanDOMChar*             uri,
  +                     int                                             lineNo,
  +                     int                                             
charOffset);
   
   private:
   
  
  
  

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

Reply via email to