dbertoni    2002/08/04 21:56:51

  Modified:    c/src/XPath XPathEnvSupportDefault.cpp
                        XPathFunctionTable.cpp XPathFunctionTable.hpp
  Log:
  Improved error reporting with exception.
  
  Revision  Changes    Path
  1.32      +8 -1      xml-xalan/c/src/XPath/XPathEnvSupportDefault.cpp
  
  Index: XPathEnvSupportDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathEnvSupportDefault.cpp,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- XPathEnvSupportDefault.cpp        6 Apr 2002 07:53:33 -0000       1.31
  +++ XPathEnvSupportDefault.cpp        5 Aug 2002 04:56:51 -0000       1.32
  @@ -452,7 +452,14 @@
   
                theFunctionName += functionName;
   
  -             throw XPathExceptionFunctionNotAvailable(theFunctionName);
  +             if (locator != 0)
  +             {
  +                     throw 
XPathExceptionFunctionNotAvailable(theFunctionName, *locator);
  +             }
  +             else
  +             {
  +                     throw 
XPathExceptionFunctionNotAvailable(theFunctionName);
  +             }
   
                // dummy return value...
                return XObjectPtr();
  
  
  
  1.17      +23 -7     xml-xalan/c/src/XPath/XPathFunctionTable.cpp
  
  Index: XPathFunctionTable.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathFunctionTable.cpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- XPathFunctionTable.cpp    4 Jan 2002 17:29:07 -0000       1.16
  +++ XPathFunctionTable.cpp    5 Aug 2002 04:56:51 -0000       1.17
  @@ -306,11 +306,26 @@
   
   
   
  +XPathExceptionFunctionNotAvailable::XPathExceptionFunctionNotAvailable(int   
theFunctionNumber) :
  +     XalanXPathException(TranscodeFromLocalCodePage("The specified function 
number is not available: ") + LongToDOMString(theFunctionNumber))
  +{
  +}
  +
  +
  +
  +XPathExceptionFunctionNotAvailable::XPathExceptionFunctionNotAvailable(const 
XalanDOMString& theFunctionName) :
  +     XalanXPathException(TranscodeFromLocalCodePage("The specified function 
is not available: ") + theFunctionName)
  +{
  +}
  +
  +
  +
   XPathExceptionFunctionNotAvailable::XPathExceptionFunctionNotAvailable(
  -             int                                     theFunctionNumber,
  -             const XalanNode*        styleNode) :
  -     XalanXPathException(TranscodeFromLocalCodePage("The specified function 
ID is not available: ") + LongToDOMString(theFunctionNumber),
  -                                styleNode)
  +                     int                             theFunctionNumber,
  +                     const Locator&  theLocator) :
  +     XalanXPathException(
  +                                     theLocator,
  +                                     TranscodeFromLocalCodePage("The 
specified function number is not available: ") + 
LongToDOMString(theFunctionNumber))
   {
   }
   
  @@ -318,9 +333,10 @@
   
   XPathExceptionFunctionNotAvailable::XPathExceptionFunctionNotAvailable(
                        const XalanDOMString&   theFunctionName,
  -                     const XalanNode*                styleNode) :
  -     XalanXPathException(TranscodeFromLocalCodePage("The specified function 
is not available: ") + theFunctionName,
  -                                styleNode)
  +                     const Locator&                  theLocator) :
  +     XalanXPathException(
  +                                     theLocator,
  +                                     TranscodeFromLocalCodePage("The 
specified function is not available: ") + theFunctionName)
   {
   }
   
  
  
  
  1.15      +11 -3     xml-xalan/c/src/XPath/XPathFunctionTable.hpp
  
  Index: XPathFunctionTable.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathFunctionTable.hpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- XPathFunctionTable.hpp    4 Jan 2002 17:29:07 -0000       1.14
  +++ XPathFunctionTable.hpp    5 Aug 2002 04:56:51 -0000       1.15
  @@ -82,6 +82,10 @@
   
   
   
  +class Locator;
  +
  +
  +
   /**
    * Exception class thrown when an unknown function is encountered
    */
  @@ -89,13 +93,17 @@
   {
   public:
   
  +     XPathExceptionFunctionNotAvailable(int  theFunctionNumber);
  +
  +     XPathExceptionFunctionNotAvailable(const XalanDOMString&        
theFunctionName);
  +
        XPathExceptionFunctionNotAvailable(
  -             int                                     theFunctionName,
  -             const XalanNode*        styleNode = 0);
  +             int                                     theFunctionNumber,
  +             const Locator&          theLocator);
   
        XPathExceptionFunctionNotAvailable(
                const XalanDOMString&   theFunctionName,
  -             const XalanNode*                styleNode = 0);
  +             const Locator&                  theLocator);
   
        ~XPathExceptionFunctionNotAvailable();
   };
  
  
  

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

Reply via email to