You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sb...@apache.org on 2002/06/07 19:13:55 UTC

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

sboag       2002/06/07 10:13:55

  Modified:    java/src/org/apache/xalan/lib/sql DefaultConnectionPool.java
               java/src/org/apache/xalan/processor
                        TransformerFactoryImpl.java
               java/src/org/apache/xalan/res XSLMessages.java
                        XSLTErrorResources.java
                        XSLTErrorResources.properties
               java/src/org/apache/xalan/templates
                        RedundentExprEliminator.java
               java/src/org/apache/xml/dtm/ref
                        DTMDefaultBaseTraversers.java
               java/src/org/apache/xml/utils ListingErrorHandler.java
               java/src/org/apache/xml/utils/synthetic JavaUtils.java
               java/src/org/apache/xpath VariableStack.java
               java/src/org/apache/xpath/functions FuncConcat.java
                        Function.java Function2Args.java Function3Args.java
                        FunctionOneArg.java
               java/src/org/apache/xpath/res XPATHErrorResources.java
                        XPATHErrorResources.properties
  Log:
  Integrated some removal of hard-coded error messages.
  
  Revision  Changes    Path
  1.10      +15 -11    xml-xalan/java/src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
  
  Index: DefaultConnectionPool.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/lib/sql/DefaultConnectionPool.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultConnectionPool.java	14 Aug 2001 17:07:50 -0000	1.9
  +++ DefaultConnectionPool.java	7 Jun 2002 17:13:54 -0000	1.10
  @@ -56,16 +56,16 @@
    */
   package org.apache.xalan.lib.sql;
   
  -import java.util.Properties;
  -import java.util.Vector;
  -import java.util.Enumeration;
  -import java.lang.String;
   import java.sql.Connection;
  -import java.sql.SQLException;
   import java.sql.DatabaseMetaData;
   import java.sql.DriverManager;
  -import java.util.*;
  -import java.sql.*;
  +import java.sql.SQLException;
  +import java.util.Enumeration;
  +import java.util.Properties;
  +import java.util.Vector;
  +
  +import org.apache.xalan.res.XSLMessages;
  +import org.apache.xalan.res.XSLTErrorResources;
   
   /**
    * For internal connectiones, i.e. Connection information supplies in the
  @@ -449,17 +449,20 @@
        // Check our initial values
        if ( m_driver == null )
        {
  -       throw new IllegalArgumentException("No Driver Name Specified!");
  +       throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_DRIVER_NAME_SPECIFIED, null));
  +       // "No Driver Name Specified!");
        }
   
        if ( m_url == null )
        {
  -       throw new IllegalArgumentException("No URL Specified!");
  +       throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_URL_SPECIFIED, null));
  +       // "No URL Specified!");
        }
   
        if ( m_PoolMinSize < 1 )
        {
  -       throw new IllegalArgumentException("Pool size is less than 1!");
  +       throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_POOLSIZE_LESS_THAN_ONE, null));
  +       // "Pool size is less than 1!");
        }
   
        // Create the Connections
  @@ -471,7 +474,8 @@
        }
        catch(ClassNotFoundException e)
        {
  -       throw new IllegalArgumentException("Invalid Driver Name Specified!");
  +       throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null));
  +       // "Invalid Driver Name Specified!");
        }
   
        // IF we are not active, don't actuall build a pool yet
  
  
  
  1.42      +2 -1      xml-xalan/java/src/org/apache/xalan/processor/TransformerFactoryImpl.java
  
  Index: TransformerFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/processor/TransformerFactoryImpl.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- TransformerFactoryImpl.java	31 Jan 2002 16:08:21 -0000	1.41
  +++ TransformerFactoryImpl.java	7 Jun 2002 17:13:54 -0000	1.42
  @@ -1075,7 +1075,8 @@
     {
   
       if (null == listener)
  -      throw new IllegalArgumentException("ErrorListener");
  +      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ERRORLISTENER, null));
  +      // "ErrorListener");
   
       m_errorListener = listener;
     }
  
  
  
  1.9       +28 -1     xml-xalan/java/src/org/apache/xalan/res/XSLMessages.java
  
  Index: XSLMessages.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/res/XSLMessages.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XSLMessages.java	22 May 2002 20:12:53 -0000	1.8
  +++ XSLMessages.java	7 Jun 2002 17:13:54 -0000	1.9
  @@ -171,6 +171,34 @@
       else
         return "Could not load any resource bundles.";
     }
  +  
  +  /**
  +   * Creates a message from the specified key and replacement
  +   * arguments, localized to the given locale.
  +   *
  +   * @param errorCode The key for the message text.
  +   * @param args      The arguments to be used as replacement text
  +   *                  in the message created.
  +   *
  +   * @return The formatted message string.
  +   */
  +  public static final String createXPATHMessage(String msgKey, Object args[])  //throws Exception 
  +  {
  +
  +    if (XPATHBundle == null)
  +      XPATHBundle =
  +        loadResourceBundle(XPATH_ERROR_RESOURCES);
  +
  +    ResourceBundle fResourceBundle = XPATHBundle;
  +
  +    if (fResourceBundle != null)
  +    {
  +      return createXPATHMsg(fResourceBundle, msgKey, args);
  +    }
  +    else
  +      return "Could not load any resource bundles.";
  +  }
  +
   
     /**
      * Creates a message from the specified key and replacement
  @@ -321,7 +349,6 @@
       else
         return "Could not load any resource bundles.";
     }
  -  
   
     /**
      * Creates a message from the specified key and replacement
  
  
  
  1.26      +50 -25    xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.java
  
  Index: XSLTErrorResources.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- XSLTErrorResources.java	13 May 2002 21:20:17 -0000	1.25
  +++ XSLTErrorResources.java	7 Jun 2002 17:13:54 -0000	1.26
  @@ -94,17 +94,17 @@
     /** The warning suffix for construction error property keys.   */
     public static final String WARNING_SUFFIX = "WR";
   
  -  /** Maximum error messages, this is needed to keep track of the number of messages.    */
  -  public static final int MAX_CODE = 217;          
  -
  -  /** Maximum warnings, this is needed to keep track of the number of warnings.          */
  -  public static final int MAX_WARNING = 26;
  -
  -  /** Maximum misc strings.   */
  -  public static final int MAX_OTHERS = 45;
  -
  -  /** Maximum total warnings and error messages.          */
  -  public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
  +//  /** Maximum error messages, this is needed to keep track of the number of messages.    */
  +//  public static final int MAX_CODE = 226;          
  +//
  +//  /** Maximum warnings, this is needed to keep track of the number of warnings.          */
  +//  public static final int MAX_WARNING = 26;
  +//
  +//  /** Maximum misc strings.   */
  +//  public static final int MAX_OTHERS = 45;
  +//
  +//  /** Maximum total warnings and error messages.          */
  +//  public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
   
     /*
      * Now fill in the message text.
  @@ -988,9 +988,34 @@
     
     /** Attempting to generate a namespace prefix with a null URI   */
     public static final int ER_NUMBER_TOO_BIG = 217;
  -
  -  
     
  +// No Driver Name Specified!
  +  public static final int ER_NO_DRIVER_NAME_SPECIFIED = 228;
  +
  +// No URL Specified!
  +  public static final int ER_NO_URL_SPECIFIED = 229; 
  +
  +// Pool size is less than 1!
  +  public static final int ER_POOLSIZE_LESS_THAN_ONE = 230;
  +
  +// Invalid Driver Name Specified!
  +  public static final int ER_INVALID_DRIVER_NAME = 231;
  +
  +// ErrorListener
  +  public static final int ER_ERRORLISTENER = 232;
  +
  +// Programmer's error! expr has no ElemTemplateElement parent!
  +  public static final int ER_ASSERT_NO_TEMPLATE_PARENT = 233;
  +
  +// Programmer's assertion in RundundentExprEliminator: {0}
  +  public static final int ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR = 234;
  +
  +// Axis traverser not supported: {0}
  +  public static final int ER_AXIS_TRAVERSER_NOT_SUPPORTED = 235;
  +
  +// ListingErrorHandler created with null PrintWriter!
  +  public static final int ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = 236;
  +
     /*
       /**  Cannot find SAX1 driver class    *
     public static final int ER_CANNOT_FIND_SAX1_DRIVER = 190;
  @@ -1255,9 +1280,9 @@
     public static String getMessageKey(int errorCode)
     {
   
  -    if (errorCode > MAX_CODE)
  -      return null;
  -    else
  +//    if (errorCode > MAX_CODE)
  +//      return null;
  +//    else
       {
         DecimalFormat df = new DecimalFormat("0000");
   
  @@ -1276,9 +1301,9 @@
     public static String getWarningKey(int errorCode)
     {
   
  -    if (errorCode > MAX_WARNING)
  -      return null;
  -    else
  +//    if (errorCode > MAX_WARNING)
  +//      return null;
  +//    else
       {
         DecimalFormat df = new DecimalFormat("0000");
   
  @@ -1296,9 +1321,9 @@
      */
     public static String getMKey(int errorCode)
     {
  -    if (errorCode > MAX_CODE)
  -      return null;
  -    else
  +//    if (errorCode > MAX_CODE)
  +//      return null;
  +//    else
       {
         DecimalFormat df = new DecimalFormat("0000");
   
  @@ -1317,9 +1342,9 @@
     public static String getWKey(int errorCode)
     {
   
  -    if (errorCode > MAX_WARNING)
  -      return null;
  -    else
  +//    if (errorCode > MAX_WARNING)
  +//      return null;
  +//    else
       {
         DecimalFormat df = new DecimalFormat("0000");
   
  
  
  
  1.3       +22 -1     xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.properties
  
  Index: XSLTErrorResources.properties
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XSLTErrorResources.properties	22 May 2002 20:12:53 -0000	1.2
  +++ XSLTErrorResources.properties	7 Jun 2002 17:13:54 -0000	1.3
  @@ -440,6 +440,7 @@
   ER0216=Attempting to generate a namespace prefix with a null URI
   # ER_NUMBER_TOO_BIG
   ER0217=Attempting to format a number bigger than the largest Long integer
  +
   # ER_CANNOT_FIND_SAX1_DRIVER
   ER0218=Cannot find SAX1 driver class {0}
   # ER_SAX1_DRIVER_NOT_LOADED
  @@ -460,6 +461,26 @@
   ER0226=Null entity resolver
   # ER_NULL_DTD_HANDLER
   ER0227=Null DTD handler
  +
  +# ER_NO_DRIVER_NAME_SPECIFIED
  +ER0228=No Driver Name Specified!
  +# ER_NO_URL_SPECIFIED
  +ER0229=No URL Specified!
  +# ER_POOLSIZE_LESS_THAN_ONE
  +ER0230=Pool size is less than 1!
  +# ER_INVALID_DRIVER_NAME
  +ER0231=Invalid Driver Name Specified!
  +# ER_ERRORLISTENER (I don't think this one should be translated!)
  +ER0232=ErrorListener
  +# ER_ASSERT_NO_TEMPLATE_PARENT
  +ER0233=Programmer's error! expr has no ElemTemplateElement parent!
  +# ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR
  +ER0234=Programmer's assertion in RundundentExprEliminator: {0}
  +# ER_AXIS_TRAVERSER_NOT_SUPPORTED
  +ER0235=Axis traverser not supported: {0}
  +# ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER!
  +ER0236=ListingErrorHandler created with null PrintWriter!
  +
   # WG_FOUND_CURLYBRACE 
   WR0001=Found '}' but no attribute template open!
   # WG_COUNT_ATTRIB_MATCHES_NO_ANCESTOR 
  @@ -564,4 +585,4 @@
   optionENTITYRESOLVER=   [-ENTITYRESOLVER full class name (EntityResolver to be used to resolve entities)]
   optionCONTENTHANDLER=   [-CONTENTHANDLER full class name (ContentHandler to be used to serialize output)]
   optionLINENUMBERS=   [-L use line numbers for source document]
  -diagTiming= --------- Transform of {0} via {1} took {2} ms
  +diagTiming= --------- Transform of {0} via {1} took {2} ms
  \ No newline at end of file
  
  
  
  1.3       +6 -2      xml-xalan/java/src/org/apache/xalan/templates/RedundentExprEliminator.java
  
  Index: RedundentExprEliminator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/RedundentExprEliminator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RedundentExprEliminator.java	22 Mar 2002 01:04:40 -0000	1.2
  +++ RedundentExprEliminator.java	7 Jun 2002 17:13:54 -0000	1.3
  @@ -58,6 +58,8 @@
   
   import java.util.Vector;
   
  +import org.apache.xalan.res.XSLMessages;
  +import org.apache.xalan.res.XSLTErrorResources;
   import org.apache.xml.utils.QName;
   import org.apache.xml.utils.WrappedRuntimeException;
   import org.apache.xpath.Expression;
  @@ -1082,7 +1084,8 @@
     			return (ElemTemplateElement)parent;
     		parent = parent.exprGetParent();
     	}
  -  	throw new RuntimeException("Programmer's error! expr has no ElemTemplateElement parent!");
  +  	throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_ASSERT_NO_TEMPLATE_PARENT, null));
  +  	// "Programmer's error! expr has no ElemTemplateElement parent!");
     }
         
     /**
  @@ -1326,7 +1329,8 @@
     {
     	if(!b)
     	{
  -  		throw new RuntimeException("Programmer's assertion in RundundentExprEliminator: "+msg);
  +  		throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR, new Object[]{msg}));
  +  		// "Programmer's assertion in RundundentExprEliminator: "+msg);
     	}
     }
     
  
  
  
  1.11      +3 -2      xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBaseTraversers.java
  
  Index: DTMDefaultBaseTraversers.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBaseTraversers.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DTMDefaultBaseTraversers.java	15 May 2002 22:04:02 -0000	1.10
  +++ DTMDefaultBaseTraversers.java	7 Jun 2002 17:13:54 -0000	1.11
  @@ -195,8 +195,9 @@
       }
   
       if (null == traverser)
  -      throw new DTMException("Axis traverser not supported: "
  -                             + Axis.names[axis]);
  +      throw new DTMException(XSLMessages.createMessage(XSLTErrorResources.ER_AXIS_TRAVERSER_NOT_SUPPORTED, new Object[]{Axis.names[axis]}));
  +      // "Axis traverser not supported: "
  +      //                       + Axis.names[axis]);
   
       m_traversers[axis] = traverser;
   
  
  
  
  1.2       +15 -11    xml-xalan/java/src/org/apache/xml/utils/ListingErrorHandler.java
  
  Index: ListingErrorHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/utils/ListingErrorHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ListingErrorHandler.java	20 Dec 2001 21:15:15 -0000	1.1
  +++ ListingErrorHandler.java	7 Jun 2002 17:13:54 -0000	1.2
  @@ -57,19 +57,22 @@
   
   package org.apache.xml.utils;
   
  -import org.xml.sax.*;
  -import javax.xml.transform.ErrorListener;
  -import javax.xml.transform.TransformerException;
  -import javax.xml.transform.SourceLocator;
  -import java.io.PrintWriter;
  -
   import java.io.BufferedReader;
  -import java.io.IOException;
  +import java.io.InputStream;
   import java.io.InputStreamReader;
  +import java.io.PrintWriter;
  +import java.net.MalformedURLException;
   import java.net.URL;
   import java.net.URLConnection;
  -import java.io.InputStream;
  -import org.apache.xml.utils.SystemIDResolver;
  +
  +import javax.xml.transform.ErrorListener;
  +import javax.xml.transform.SourceLocator;
  +import javax.xml.transform.TransformerException;
  +import org.apache.xalan.res.XSLMessages;
  +import org.apache.xalan.res.XSLTErrorResources;
  +import org.xml.sax.ErrorHandler;
  +import org.xml.sax.SAXException;
  +import org.xml.sax.SAXParseException;
   
   
   /**
  @@ -81,7 +84,7 @@
    * when we re-throw errors, etc.</p>
    *
    * @author shane_curcuru@us.ibm.com
  - * @version $Id: ListingErrorHandler.java,v 1.1 2001/12/20 21:15:15 curcuru Exp $
  + * @version $Id: ListingErrorHandler.java,v 1.2 2002/06/07 17:13:54 sboag Exp $
    */
   public class ListingErrorHandler implements ErrorHandler, ErrorListener
   {
  @@ -94,7 +97,8 @@
       public ListingErrorHandler(PrintWriter pw)
       {
           if (null == pw)
  -            throw new NullPointerException("ListingErrorHandler created with null PrintWriter!");
  +            throw new NullPointerException(XSLMessages.createMessage(XSLTErrorResources.ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER, null));
  +            // "ListingErrorHandler created with null PrintWriter!");
               
           m_pw = pw;
       }
  
  
  
  1.4       +0 -1      xml-xalan/java/src/org/apache/xml/utils/synthetic/JavaUtils.java
  
  Index: JavaUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/utils/synthetic/JavaUtils.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JavaUtils.java	23 Jul 2001 22:40:47 -0000	1.3
  +++ JavaUtils.java	7 Jun 2002 17:13:55 -0000	1.4
  @@ -54,7 +54,6 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>. 
    *
  - * $Id: JavaUtils.java,v 1.3 2001/07/23 22:40:47 costin Exp $ 
    */
   
   package org.apache.xml.utils.synthetic;
  
  
  
  1.41      +6 -2      xml-xalan/java/src/org/apache/xpath/VariableStack.java
  
  Index: VariableStack.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/VariableStack.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- VariableStack.java	22 Mar 2002 01:04:42 -0000	1.40
  +++ VariableStack.java	7 Jun 2002 17:13:55 -0000	1.41
  @@ -314,7 +314,9 @@
       XObject val = _stackFrames[index];
       
       if(null == val)
  -      throw new TransformerException("Variable accessed before it is bound!", xctxt.getSAXLocator());
  +      throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null),
  +                     xctxt.getSAXLocator());
  +      // "Variable accessed before it is bound!", xctxt.getSAXLocator());
   
       // Lazy execution of variables.
       if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE)
  @@ -369,7 +371,9 @@
       XObject val = _stackFrames[index];
       
       if(null == val)
  -      throw new TransformerException("Variable accessed before it is bound!", xctxt.getSAXLocator());
  +      throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null),
  +                     xctxt.getSAXLocator());
  +      // "Variable accessed before it is bound!", xctxt.getSAXLocator());
   
       // Lazy execution of variables.
       if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE)
  
  
  
  1.6       +3 -4      xml-xalan/java/src/org/apache/xpath/functions/FuncConcat.java
  
  Index: FuncConcat.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/functions/FuncConcat.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FuncConcat.java	12 Jun 2001 19:16:32 -0000	1.5
  +++ FuncConcat.java	7 Jun 2002 17:13:55 -0000	1.6
  @@ -58,10 +58,9 @@
   
   //import org.w3c.dom.Node;
   
  -import java.util.Vector;
  -
  +import javax.xml.transform.TransformerException;
  +import org.apache.xalan.res.XSLMessages;
   import org.apache.xpath.XPathContext;
  -import org.apache.xpath.XPath;
   import org.apache.xpath.objects.XObject;
   import org.apache.xpath.objects.XString;
   
  @@ -114,6 +113,6 @@
     public void checkNumberArgs(int argNum) throws WrongNumberArgsException
     {
       if (argNum < 2)
  -      throw new WrongNumberArgsException(">1");
  +      throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("gtone", null));
     }
   }
  
  
  
  1.8       +4 -3      xml-xalan/java/src/org/apache/xpath/functions/Function.java
  
  Index: Function.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/functions/Function.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Function.java	13 May 2002 21:07:44 -0000	1.7
  +++ Function.java	7 Jun 2002 17:13:55 -0000	1.8
  @@ -59,12 +59,13 @@
   //import org.w3c.dom.Node;
   
   import javax.xml.transform.TransformerException;
  +import org.apache.xalan.res.XSLMessages;
   import org.apache.xpath.Expression;
   import org.apache.xpath.ExpressionOwner;
   import org.apache.xpath.XPathContext;
   import org.apache.xpath.XPathVisitor;
  -import org.apache.xpath.objects.XObject;
   import org.apache.xpath.compiler.Compiler;
  +import org.apache.xpath.objects.XObject;
   
   /**
    * <meta name="usage" content="advanced"/>
  @@ -92,7 +93,7 @@
     public void setArg(Expression arg, int argNum)
             throws WrongNumberArgsException
     {
  -    throw new WrongNumberArgsException("0");
  +    throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("zero", null));
     }
   
     /**
  @@ -108,7 +109,7 @@
     public void checkNumberArgs(int argNum) throws WrongNumberArgsException
     {
       if (argNum != 0)
  -      throw new WrongNumberArgsException("0");
  +      throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("zero", null));
     }
   
     /**
  
  
  
  1.8       +3 -2      xml-xalan/java/src/org/apache/xpath/functions/Function2Args.java
  
  Index: Function2Args.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/functions/Function2Args.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Function2Args.java	22 Mar 2002 01:04:44 -0000	1.7
  +++ Function2Args.java	7 Jun 2002 17:13:55 -0000	1.8
  @@ -58,6 +58,7 @@
   
   import java.util.Vector;
   
  +import org.apache.xalan.res.XSLMessages;
   import org.apache.xpath.Expression;
   import org.apache.xpath.ExpressionOwner;
   import org.apache.xpath.XPathVisitor;
  @@ -124,7 +125,7 @@
         arg.exprSetParent(this);
       }
       else
  -      throw new WrongNumberArgsException("2");
  +      throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("two", null));
     }
   
     /**
  @@ -138,7 +139,7 @@
     public void checkNumberArgs(int argNum) throws WrongNumberArgsException
     {
       if (argNum != 2)
  -      throw new WrongNumberArgsException("2");
  +      throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("two", null));
     }
     
     /**
  
  
  
  1.9       +3 -2      xml-xalan/java/src/org/apache/xpath/functions/Function3Args.java
  
  Index: Function3Args.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/functions/Function3Args.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Function3Args.java	22 Mar 2002 01:04:44 -0000	1.8
  +++ Function3Args.java	7 Jun 2002 17:13:55 -0000	1.9
  @@ -58,6 +58,7 @@
   
   import java.util.Vector;
   
  +import org.apache.xalan.res.XSLMessages;
   import org.apache.xpath.Expression;
   import org.apache.xpath.ExpressionOwner;
   import org.apache.xpath.XPathVisitor;
  @@ -122,7 +123,7 @@
         arg.exprSetParent(this);
       }
       else
  -      throw new WrongNumberArgsException("3");
  +      throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("three", null));
     }
   
     /**
  @@ -136,7 +137,7 @@
     public void checkNumberArgs(int argNum) throws WrongNumberArgsException
     {
       if (argNum != 3)
  -      throw new WrongNumberArgsException("3");
  +      throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("three", null));
     }
     
     /**
  
  
  
  1.8       +3 -2      xml-xalan/java/src/org/apache/xpath/functions/FunctionOneArg.java
  
  Index: FunctionOneArg.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/functions/FunctionOneArg.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionOneArg.java	22 Mar 2002 01:04:44 -0000	1.7
  +++ FunctionOneArg.java	7 Jun 2002 17:13:55 -0000	1.8
  @@ -58,6 +58,7 @@
   
   import java.util.Vector;
   
  +import org.apache.xalan.res.XSLMessages;
   import org.apache.xpath.Expression;
   import org.apache.xpath.ExpressionOwner;
   import org.apache.xpath.XPathVisitor;
  @@ -103,7 +104,7 @@
         arg.exprSetParent(this);
       }
       else
  -      throw new WrongNumberArgsException("1");
  +      throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("one", null));
     }
   
     /**
  @@ -117,7 +118,7 @@
     public void checkNumberArgs(int argNum) throws WrongNumberArgsException
     {
       if (argNum != 1)
  -      throw new WrongNumberArgsException("1");
  +      throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("one", null));
     }
     
     /**
  
  
  
  1.13      +38 -37    xml-xalan/java/src/org/apache/xpath/res/XPATHErrorResources.java
  
  Index: XPATHErrorResources.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/res/XPATHErrorResources.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- XPATHErrorResources.java	13 May 2002 21:20:17 -0000	1.12
  +++ XPATHErrorResources.java	7 Jun 2002 17:13:55 -0000	1.13
  @@ -96,21 +96,21 @@
     /** Field WARNING_SUFFIX          */
     public static final String WARNING_SUFFIX = "WR";
   
  -  /** Field MAX_CODE          */
  -  public static final int MAX_CODE = 84;  // this is needed to keep track of the number of messages          
  -
  -  /** Field MAX_WARNING          */
  -  public static final int MAX_WARNING = 11;  // this is needed to keep track of the number of warnings
  -
  -  /** Field MAX_OTHERS          */
  -  public static final int MAX_OTHERS = 20;
  -
  -  /** Field MAX_MESSAGES          */
  -  public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
  -
  -  /** Field contents          */
  -  static final Object[][] contents =
  -    new Object[MAX_MESSAGES + MAX_OTHERS + 1][2];
  +//  /** Field MAX_CODE          */
  +//  public static final int MAX_CODE = 84;  // this is needed to keep track of the number of messages          
  +//
  +//  /** Field MAX_WARNING          */
  +//  public static final int MAX_WARNING = 11;  // this is needed to keep track of the number of warnings
  +//
  +//  /** Field MAX_OTHERS          */
  +//  public static final int MAX_OTHERS = 20;
  +//
  +//  /** Field MAX_MESSAGES          */
  +//  public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
  +//
  +//  /** Field contents          */
  +//  static final Object[][] contents =
  +//    new Object[MAX_MESSAGES + MAX_OTHERS + 1][2];
   
     /*
     * Now fill in the message text.
  @@ -462,7 +462,8 @@
     public static final int ER_TWO_OR_THREE = 84;
   
     
  -  
  +// Variable accessed before it is bound!
  +  public static final int ER_VARIABLE_ACCESSED_BEFORE_BIND = 85;
   
   
     // Warnings...
  @@ -547,15 +548,15 @@
     /** Field QUERY_HEADER          */
     public static final String QUERY_HEADER = "PATTERN ";
   
  -  /**
  -   * Get the association list.
  -   *
  -   * @return The association list.
  -   */
  -  public Object[][] getContents()
  -  {
  -    return contents;
  -  }
  +//  /**
  +//   * Get the association list.
  +//   *
  +//   * @return The association list.
  +//   */
  +//  public Object[][] getContents()
  +//  {
  +//    return contents;
  +//  }
   
     /**
      * Return a named ResourceBundle for a particular locale.  This method mimics the behavior
  @@ -633,9 +634,9 @@
     public static String getMessageKey(int errorCode)
     {
   
  -    if (errorCode > MAX_CODE)
  -      return null;
  -    else
  +//    if (errorCode > MAX_CODE)
  +//      return null;
  +//    else
       {
         DecimalFormat df = new DecimalFormat("0000");
   
  @@ -653,9 +654,9 @@
     public static String getWarningKey(int errorCode)
     {
   
  -    if (errorCode > MAX_WARNING)
  -      return null;
  -    else
  +//    if (errorCode > MAX_WARNING)
  +//      return null;
  +//    else
       {
         DecimalFormat df = new DecimalFormat("0000");
   
  @@ -673,9 +674,9 @@
     public static String getMKey(int errorCode)
     {
   
  -    if (errorCode > MAX_CODE)
  -      return null;
  -    else
  +//    if (errorCode > MAX_CODE)
  +//      return null;
  +//    else
       {
         DecimalFormat df = new DecimalFormat("0000");
   
  @@ -693,9 +694,9 @@
     public static String getWKey(int errorCode)
     {
   
  -    if (errorCode > MAX_WARNING)
  -      return null;
  -    else
  +//    if (errorCode > MAX_WARNING)
  +//      return null;
  +//    else
       {
         DecimalFormat df = new DecimalFormat("0000");
   
  
  
  
  1.2       +8 -0      xml-xalan/java/src/org/apache/xpath/res/XPATHErrorResources.properties
  
  Index: XPATHErrorResources.properties
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/res/XPATHErrorResources.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XPATHErrorResources.properties	12 May 2002 18:34:03 -0000	1.1
  +++ XPATHErrorResources.properties	7 Jun 2002 17:13:55 -0000	1.2
  @@ -174,6 +174,9 @@
   ER0083=The FastStringBuffer argument can not be null
   # ER_TWO_OR_THREE
   ER0084=0 or 1
  +# ER_VARIABLE_ACCESSED_BEFORE_BIND
  +ER0085=Variable accessed before it is bound!
  +
   # WG_LOCALE_NAME_NOT_HANDLED 
   WR0001=locale name in the format-number function not yet handled!
   # WG_PROPERTY_NOT_SUPPORTED 
  @@ -219,3 +222,8 @@
   noParsermsg3=Please check your classpath.
   noParsermsg4=If you don't have IBM's XML Parser for Java, you can download it from
   noParsermsg5=IBM's AlphaWorks\u003a http\u003a//www.alphaworks.ibm.com/formula/xml
  +gtone=>1
  +zero=0
  +one=1
  +two=2
  +three=3
  \ No newline at end of file
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org