You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by ro...@locus.apache.org on 2000/02/16 20:12:54 UTC

cvs commit: xml-xalan/src/org/apache/xalan/xpath/res XPATHErrorResources.java

robweir     00/02/16 11:12:54

  Modified:    src/org/apache/xalan/xpath XPath.java
               src/org/apache/xalan/xpath/res XPATHErrorResources.java
  Log:
  Make it an error rather than a warning when we use an undefined
  or out-of-scope variable
  
  Revision  Changes    Path
  1.16      +1 -1      xml-xalan/src/org/apache/xalan/xpath/XPath.java
  
  Index: XPath.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xpath/XPath.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- XPath.java	2000/02/13 16:42:41	1.15
  +++ XPath.java	2000/02/16 19:12:54	1.16
  @@ -859,7 +859,7 @@
   
       if(null == result)
       {
  -      warn(context, XPATHErrorResources.WG_ILLEGAL_VARIABLE_REFERENCE, new Object[] {varName}); //"VariableReference given for variable out "+
  +      error(context, XPATHErrorResources.ER_ILLEGAL_VARIABLE_REFERENCE, new Object[] {varName}); //"VariableReference given for variable out "+
                       //"of context or without definition!  Name = " + varName);
       }
   
  
  
  
  1.8       +12 -10    xml-xalan/src/org/apache/xalan/xpath/res/XPATHErrorResources.java
  
  Index: XPATHErrorResources.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xpath/res/XPATHErrorResources.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XPATHErrorResources.java	2000/01/05 23:05:29	1.7
  +++ XPATHErrorResources.java	2000/02/16 19:12:54	1.8
  @@ -19,8 +19,8 @@
   public static final String ERROR_SUFFIX = "ER";  
   public static final String WARNING_SUFFIX = "WR";
   
  -public static final int MAX_CODE = 42;                // this is needed to keep track of the number of messages          
  -public static final int MAX_WARNING = 10;             // this is needed to keep track of the number of warnings
  +public static final int MAX_CODE = 43;                // this is needed to keep track of the number of messages          
  +public static final int MAX_WARNING = 9;             // this is needed to keep track of the number of warnings
   public static final int MAX_OTHERS = 20;
   public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING +1;
   
  @@ -270,6 +270,12 @@
             = "Error occured!";
   }
   
  +public static final int ER_ILLEGAL_VARIABLE_REFERENCE  = 43;
  +static {contents[ER_ILLEGAL_VARIABLE_REFERENCE][1] 
  +          = "VariableReference given for variable out of context or without definition!  Name = {0}";
  +}
  +
  +
   // Warnings...
   
   public static final int WG_LOCALE_NAME_NOT_HANDLED  = 1;
  @@ -297,27 +303,23 @@
             = "Old syntax: quo(...) is no longer defined in XPath.";
   }
   
  -public static final int WG_ILLEGAL_VARIABLE_REFERENCE  = 6;
  -static {contents[WG_ILLEGAL_VARIABLE_REFERENCE  + MAX_CODE][1] 
  -          = "VariableReference given for variable out of context or without definition!  Name = {0}";
  -}
   
  -public static final int WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST  = 7;
  +public static final int WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST  = 6;
   static {contents[WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST  + MAX_CODE][1] 
             = "XPath needs a derived object to implement nodeTest!";
   }
   
  -public static final int WG_FUNCTION_TOKEN_NOT_FOUND  = 8;
  +public static final int WG_FUNCTION_TOKEN_NOT_FOUND  = 7;
   static {contents[WG_FUNCTION_TOKEN_NOT_FOUND  + MAX_CODE][1] 
             = "function token not found.";
   }
   
  -public static final int WG_COULDNOT_FIND_FUNCTION  = 9;
  +public static final int WG_COULDNOT_FIND_FUNCTION  = 8;
   static {contents[WG_COULDNOT_FIND_FUNCTION  + MAX_CODE][1] 
             = "Could not find function: {0}";
   }
   
  -public static final int WG_CANNOT_MAKE_URL_FROM  = 10;
  +public static final int WG_CANNOT_MAKE_URL_FROM  = 9;
   static {contents[WG_CANNOT_MAKE_URL_FROM  + MAX_CODE][1] 
             = "Can not make URL from: {0}";
   }