You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Gopal Sharma <Go...@Sun.COM> on 2001/09/06 17:21:45 UTC

Few Changes in V2 branch code

Hi,

In an effort of building xerces.jar using the schema code from V2 branch only. I 
have found some dependencies on v1 branch while using different datatypes, 
mostly on regular expressions, I have corrected them. Please find the attached 
CVS diff.I hope, it will help.
 

Cheers

Gopal
-----------------------
SUN Microsystems, India

Re: Few Changes in V2 branch code

Posted by Andy Clark <an...@apache.org>.
It looks like your editor is adding spurious whitespace to
the end of your files. So the diff flags it as different
even though it's really not. This makes it much harder to
figure out what the changes really are by looking at the
diff.

-- 
Andy Clark * IBM, TRL - Japan * andyc@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


Re: Few Changes in V2 branch code

Posted by Elena Litani <el...@ca.ibm.com>.
Gopal,

Gopal Sharma wrote:
> I
> have found some dependencies on v1 branch while using different datatypes,
> mostly on regular expressions, I have corrected them. Please find the attached
> CVS diff.I hope, it will help.

v2 directory does not have any regex code. If I apply your patch the
datatypes code in v2 won't compile. We had some dependency on regex code
in v1 because there is no plans to change that code. The code will be
eventually moved out to util directory and thus we did not see any
reason to duplicate the same code in v1 and v2 directories. It works
well for us now. However, if you still have concerns we could try to
move regex code out of v1 to util directory sooner..

Thx,
Elena.

> 
> Cheers
> 
> Gopal
> -----------------------
> SUN Microsystems, India
> 
>   ------------------------------------------------------------------------
> ? change
> Index: AbstractDatatypeValidator.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/datatypes/AbstractDatatypeValidator.java,v
> retrieving revision 1.4
> diff -u -r1.4 AbstractDatatypeValidator.java
> --- AbstractDatatypeValidator.java      2001/09/05 21:16:03     1.4
> +++ AbstractDatatypeValidator.java      2001/09/06 15:15:26
> @@ -2,7 +2,7 @@
>   * The Apache Software License, Version 1.1
>   *
>   *
> - * Copyright (c) 2000 The Apache Software Foundation.  All rights
> + * Copyright (c) 2000 The Apache Software Foundation.  All rights
>   * reserved.
>   *
>   * Redistribution and use in source and binary forms, with or without
> @@ -10,7 +10,7 @@
>   * are met:
>   *
>   * 1. Redistributions of source code must retain the above copyright
> - *    notice, this list of conditions and the following disclaimer.
> + *    notice, this list of conditions and the following disclaimer.
>   *
>   * 2. Redistributions in binary form must reproduce the above copyright
>   *    notice, this list of conditions and the following disclaimer in
> @@ -18,7 +18,7 @@
>   *    distribution.
>   *
>   * 3. The end-user documentation included with the redistribution,
> - *    if any, must include the following acknowledgment:
> + *    if any, must include the following acknowledgment:
>   *       "This product includes software developed by the
>   *        Apache Software Foundation (http://www.apache.org/)."
>   *    Alternately, this acknowledgment may appear in the software itself,
> @@ -26,7 +26,7 @@
>   *
>   * 4. The names "Xerces" and "Apache Software Foundation" must
>   *    not be used to endorse or promote products derived from this
> - *    software without prior written permission. For written
> + *    software without prior written permission. For written
>   *    permission, please contact apache@apache.org.
>   *
>   * 5. Products derived from this software may not be called "Apache",
> @@ -70,18 +70,18 @@
>  import java.util.Locale;
>  import org.apache.xerces.impl.v2.XSType;
> 
> -import org.apache.xerces.impl.v1.util.regex.RegularExpression;
> +import org.apache.xerces.impl.v2.util.regex.RegularExpression;
> 
>  public abstract class AbstractDatatypeValidator implements DatatypeValidator, Cloneable {
> 
> -    protected DatatypeValidator fBaseValidator = null;
> +    protected DatatypeValidator fBaseValidator = null;
>      protected String            fPattern         = null;
>      protected RegularExpression fRegex    = null;
>      protected short             fFacetsDefined          = 0;
>      protected DatatypeMessageProvider fMessageProvider = new DatatypeMessageProvider();
>      protected Locale            fLocale  = null;
>      protected short             fFlags = 0; //flags fixed facets
> -
> +
>       /**
>       * Checks that "content" string is valid
>       * datatype.
> @@ -99,9 +99,9 @@
>       * @see         org.apache.xerces.validators.datatype.InvalidDatatypeValueException
>       */
>      abstract public Object validate(String content, Object state) throws InvalidDatatypeValueException;
> -
> +
>      abstract public Object clone() throws CloneNotSupportedException ;
> -
> +
>      /**
>       * default value for whiteSpace facet is collapse
>       * this function is overwritten in StringDatatypeValidator
> Index: AbstractNumericFacetValidator.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/datatypes/AbstractNumericFacetValidator.java,v
> retrieving revision 1.1
> diff -u -r1.1 AbstractNumericFacetValidator.java
> --- AbstractNumericFacetValidator.java  2001/08/24 22:26:29     1.1
> +++ AbstractNumericFacetValidator.java  2001/09/06 15:15:30
> @@ -63,13 +63,13 @@
>  import java.util.Vector;
>  import java.io.IOException;
>  import org.apache.xerces.impl.v2.SchemaSymbols;
> -import org.apache.xerces.impl.v1.util.regex.RegularExpression;
> +import org.apache.xerces.impl.v2.util.regex.RegularExpression;
> 
>  /**
>   * AbstractNumericFacetValidator is a base class for decimal, double, float,
> - * and all date/time datatype validators. It implements evaluation of common facets -
> + * and all date/time datatype validators. It implements evaluation of common facets -
>   * minInclusive, maxInclusive, minExclusive, maxExclusive according to schema specs.
> - *
> + *
>   * @author Elena Litani
>   * @version $Id: AbstractNumericFacetValidator.java,v 1.1 2001/08/24 22:26:29 elena Exp $
>   */
> @@ -88,9 +88,9 @@
>          this( null, null, false ); // Native, No Facets defined, Restriction
>      }
> 
> -    public AbstractNumericFacetValidator ( DatatypeValidator base,
> -                                           Hashtable facets,
> -                                           boolean derivedByList) throws InvalidDatatypeFacetException {
> +    public AbstractNumericFacetValidator ( DatatypeValidator base,
> +                                           Hashtable facets,
> +                                           boolean derivedByList) throws InvalidDatatypeFacetException {
>          fBaseValidator = base;
> 
>          // list types are handled by ListDatatypeValidator, we do nothing here.
> @@ -149,7 +149,7 @@
>                      }
>                      else {
>                          String msg = getErrorString(
> -                                                   DatatypeMessageProvider.fgMessageKeys[DatatypeMessageProvider.ILLEGAL_FACET_VALUE],
> +                                                   DatatypeMessageProvider.fgMessageKeys[DatatypeMessageProvider.ILLEGAL_FACET_VALUE],
>                                                     new Object [] { value, key});
>                          throw new InvalidDatatypeFacetException(msg);
>                      }
> @@ -158,18 +158,18 @@
> 
>              if (fFacetsDefined != 0) {
>                  // check 4.3.8.c1 error: maxInclusive + maxExclusive
> -                if (((fFacetsDefined & DatatypeValidator.FACET_MAXEXCLUSIVE) != 0) &&
> +                if (((fFacetsDefined & DatatypeValidator.FACET_MAXEXCLUSIVE) != 0) &&
>                      ((fFacetsDefined & DatatypeValidator.FACET_MAXINCLUSIVE) != 0)) {
>                      throw new InvalidDatatypeFacetException( "It is an error for both maxInclusive and maxExclusive to be specified for the same datatype." );
>                  }
>                  // check 4.3.9.c1 error: minInclusive + minExclusive
> -                if (((fFacetsDefined & DatatypeValidator.FACET_MINEXCLUSIVE) != 0) &&
> +                if (((fFacetsDefined & DatatypeValidator.FACET_MINEXCLUSIVE) != 0) &&
>                      ((fFacetsDefined & DatatypeValidator.FACET_MININCLUSIVE) != 0)) {
>                      throw new InvalidDatatypeFacetException( "It is an error for both minInclusive and minExclusive to be specified for the same datatype." );
>                  }
> 
>                  // check 4.3.7.c1 must: minInclusive <= maxInclusive
> -                if (((fFacetsDefined & DatatypeValidator.FACET_MAXINCLUSIVE) != 0) &&
> +                if (((fFacetsDefined & DatatypeValidator.FACET_MAXINCLUSIVE) != 0) &&
>                      ((fFacetsDefined & DatatypeValidator.FACET_MININCLUSIVE) != 0)) {
>                      result =  compareValues(fMinInclusive, fMaxInclusive);
>                      if (result == 1 || result == INDETERMINATE)
> @@ -178,7 +178,7 @@
>                  }
>                  // check 4.3.8.c2 must: minExclusive <= maxExclusive ??? minExclusive < maxExclusive
>                  if (((fFacetsDefined & DatatypeValidator.FACET_MAXEXCLUSIVE) != 0) && ((fFacetsDefined & DatatypeValidator.FACET_MINEXCLUSIVE) != 0)) {
> -                    result =compareValues(fMinExclusive, fMaxExclusive);
> +                    result =compareValues(fMinExclusive, fMaxExclusive);
>                      if (result == 1 || result == INDETERMINATE)
>                          throw new InvalidDatatypeFacetException( "minExclusive value ='" + getMinExclusive(false) + "'must be <= maxExclusive value ='" +
>                                                                   getMaxExclusive(false) + "'. " );
> @@ -211,10 +211,10 @@
> 
>                      if (((fFacetsDefined & DatatypeValidator.FACET_MAXINCLUSIVE) != 0)) {
>                          if (((numBase.fFacetsDefined & DatatypeValidator.FACET_MAXINCLUSIVE) != 0)) {
> -                            result = compareValues(fMaxInclusive, numBase.fMaxInclusive);
> +                            result = compareValues(fMaxInclusive, numBase.fMaxInclusive);
>                              if ((numBase.fFlags & DatatypeValidator.FACET_MAXINCLUSIVE) != 0 &&
>                                  result != 0) {
> -                                throw new InvalidDatatypeFacetException( "maxInclusive value = '" + getMaxInclusive(false) +
> +                                throw new InvalidDatatypeFacetException( "maxInclusive value = '" + getMaxInclusive(false) +
>                                                                           "' must be equal to base.maxInclusive value = '" +
>                                                                           getMaxInclusive(true) + "' with attribute {fixed} = true" );
>                              }
> @@ -252,7 +252,7 @@
>                              result= compareValues(fMaxExclusive, numBase.fMaxExclusive);
>                              if ((numBase.fFlags & DatatypeValidator.FACET_MAXEXCLUSIVE) != 0 &&
>                                  result != 0) {
> -                                throw new InvalidDatatypeFacetException( "maxExclusive value = '" + getMaxExclusive(false) +
> +                                throw new InvalidDatatypeFacetException( "maxExclusive value = '" + getMaxExclusive(false) +
>                                                                           "' must be equal to base.maxExclusive value = '" +
>                                                                           getMaxExclusive(true) + "' with attribute {fixed} = true" );
>                              }
> @@ -288,7 +288,7 @@
>                              result= compareValues(fMinExclusive, numBase.fMinExclusive);
>                              if ((numBase.fFlags & DatatypeValidator.FACET_MINEXCLUSIVE) != 0 &&
>                                  result != 0) {
> -                                throw new InvalidDatatypeFacetException( "minExclusive value = '" + getMinExclusive(false) +
> +                                throw new InvalidDatatypeFacetException( "minExclusive value = '" + getMinExclusive(false) +
>                                                                           "' must be equal to base.minExclusive value = '" +
>                                                                           getMinExclusive(true) + "' with attribute {fixed} = true" );
>                              }
> @@ -326,10 +326,10 @@
>                      // minInclusive >= base.maxExclusive
>                      if (((fFacetsDefined & DatatypeValidator.FACET_MININCLUSIVE) != 0)) {
>                          if (((numBase.fFacetsDefined & DatatypeValidator.FACET_MININCLUSIVE) != 0)) {
> -                            result = compareValues(fMinInclusive, numBase.fMinInclusive);
> +                            result = compareValues(fMinInclusive, numBase.fMinInclusive);
>                              if ((numBase.fFlags & DatatypeValidator.FACET_MININCLUSIVE) != 0 &&
>                                  result != 0) {
> -                                throw new InvalidDatatypeFacetException( "minInclusive value = '" + getMinInclusive(false) +
> +                                throw new InvalidDatatypeFacetException( "minInclusive value = '" + getMinInclusive(false) +
>                                                                           "' must be equal to base.minInclusive value = '" +
>                                                                           getMinInclusive(true) + "' with attribute {fixed} = true" );
>                              }
> @@ -415,9 +415,9 @@
> 
> 
>      //
> -    // Compares values in value space of give datatype
> +    // Compares values in value space of give datatype
>      //
> -    abstract protected int compareValues (Object value1, Object value2);
> +    abstract protected int compareValues (Object value1, Object value2);
> 
>      //
>      // set* functions used to set facets values
> @@ -425,8 +425,8 @@
>      abstract protected void setMaxInclusive (String value);
>      abstract protected void setMinInclusive (String value);
>      abstract protected void setMaxExclusive (String value);
> -    abstract protected void setMinExclusive (String value);
> -    abstract protected void setEnumeration (Vector enumeration)
> +    abstract protected void setMinExclusive (String value);
> +    abstract protected void setEnumeration (Vector enumeration)
>      throws InvalidDatatypeValueException;
> 
>      //
> @@ -447,7 +447,7 @@
>      // decimal has fractionDigits and totalDigits facets
>      // all other datatypes will throw InvalidDatatypeFacetException
>      //
> -    abstract protected void assignAdditionalFacets(String key, Hashtable facets)
> +    abstract protected void assignAdditionalFacets(String key, Hashtable facets)
>      throws InvalidDatatypeFacetException;
> 
>      //
> Index: AbstractNumericValidator.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/datatypes/AbstractNumericValidator.java,v
> retrieving revision 1.1
> diff -u -r1.1 AbstractNumericValidator.java
> --- AbstractNumericValidator.java       2001/08/24 22:26:29     1.1
> +++ AbstractNumericValidator.java       2001/09/06 15:15:31
> @@ -64,12 +64,12 @@
>  import java.util.Vector;
>  import java.io.IOException;
>  import org.apache.xerces.impl.v2.SchemaSymbols;
> -import org.apache.xerces.impl.v1.util.regex.RegularExpression;
> +import org.apache.xerces.impl.v2.util.regex.RegularExpression;
> 
>  /**
> - * AbstractNumericValidator is a base class of decimal, double, and float
> + * AbstractNumericValidator is a base class of decimal, double, and float
>   * schema datatypes
> - *
> + *
>   * @author Elena Litani
>   * @version $Id: AbstractNumericValidator.java,v 1.1 2001/08/24 22:26:29 elena Exp $
>   */
> @@ -80,8 +80,8 @@
>          super( null, null, false ); // Native, No Facets defined, Restriction
>      }
> 
> -    public AbstractNumericValidator ( DatatypeValidator base,
> -                                      Hashtable facets,
> +    public AbstractNumericValidator ( DatatypeValidator base,
> +                                      Hashtable facets,
>                                        boolean derivedByList) throws InvalidDatatypeFacetException {
>          super (base, facets, derivedByList);
>      }
> @@ -89,10 +89,10 @@
> 
>      /**
>       * Validate string against lexical space of datatype
> -     *
> +     *
>       * @param content A string containing the content to be validated
>       * @param state
> -     * @return
> +     * @return
>       * @exception throws InvalidDatatypeException if the content is
>       *                   is not a W3C decimal type
>       * @exception InvalidDatatypeValueException
> @@ -190,7 +190,7 @@
>          }
> 
>          if ( !(minOk && maxOk) ){
> -
> +
>              String msg = getErrorString(
>                  DatatypeMessageProvider.fgMessageKeys[DatatypeMessageProvider.OUT_OF_BOUNDS],
>                  new Object [] { d.toString(), lowerBound, upperBound, lowerBoundIndicator, upperBoundIndicator});
> Index: AbstractStringValidator.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/datatypes/AbstractStringValidator.java,v
> retrieving revision 1.4
> diff -u -r1.4 AbstractStringValidator.java
> --- AbstractStringValidator.java        2001/09/05 21:16:03     1.4
> +++ AbstractStringValidator.java        2001/09/06 15:15:34
> @@ -63,7 +63,7 @@
>  import java.util.Locale;
>  import java.text.Collator;
>  import org.apache.xerces.impl.v2.SchemaSymbols;
> -import org.apache.xerces.impl.v1.util.regex.RegularExpression;
> +import org.apache.xerces.impl.v2.util.regex.RegularExpression;
>  import org.apache.xerces.util.XMLChar;
> 
>  /**
> Index: Base64BinaryDatatypeValidator.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/datatypes/Base64BinaryDatatypeValidator.java,v
> retrieving revision 1.1
> diff -u -r1.1 Base64BinaryDatatypeValidator.java
> --- Base64BinaryDatatypeValidator.java  2001/08/24 22:26:29     1.1
> +++ Base64BinaryDatatypeValidator.java  2001/09/06 15:15:34
> @@ -62,8 +62,8 @@
>  import java.util.Vector;
>  import java.util.Enumeration;
>  import org.apache.xerces.impl.v2.SchemaSymbols;
> -import org.apache.xerces.impl.v1.util.regex.RegularExpression;
> -import org.apache.xerces.impl.v1.util.Base64;
> +import org.apache.xerces.impl.v2.util.regex.RegularExpression;
> +import org.apache.xerces.impl.v2.util.Base64;
> 
>  /**
>   * Base64BinaryValidator validates that XML content is a W3C string type.
> @@ -74,9 +74,9 @@
>   * @version $Id: Base64BinaryDatatypeValidator.java,v 1.1 2001/08/24 22:26:29 elena Exp $
>   */
>  public class Base64BinaryDatatypeValidator extends AbstractStringValidator{
> -
> 
> 
> +
>      public  Base64BinaryDatatypeValidator () throws InvalidDatatypeFacetException{
>          super( null, null, false ); // Native, No Facets defined, Restriction
> 
> @@ -85,14 +85,14 @@
>      public Base64BinaryDatatypeValidator ( DatatypeValidator base, Hashtable facets,
>                                             boolean derivedByList ) throws InvalidDatatypeFacetException {
> 
> -        super (base, facets, derivedByList);
> +        super (base, facets, derivedByList);
>      }
> 
>      protected void assignAdditionalFacets(String key, Hashtable facets)  throws InvalidDatatypeFacetException{
>          String msg = getErrorString(
>              DatatypeMessageProvider.fgMessageKeys[DatatypeMessageProvider.ILLEGAL_STRING_FACET],
>              new Object[] { key });
> -        throw new InvalidDatatypeFacetException(msg);
> +        throw new InvalidDatatypeFacetException(msg);
>      }
> 
> 
> Index: BooleanDatatypeValidator.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/datatypes/BooleanDatatypeValidator.java,v
> retrieving revision 1.1
> diff -u -r1.1 BooleanDatatypeValidator.java
> --- BooleanDatatypeValidator.java       2001/08/24 22:26:29     1.1
> +++ BooleanDatatypeValidator.java       2001/09/06 15:15:35
> @@ -60,7 +60,7 @@
>  import java.util.Hashtable;
>  import java.util.Enumeration;
>  import org.apache.xerces.impl.v2.SchemaSymbols;
> -import org.apache.xerces.impl.v1.util.regex.RegularExpression;
> +import org.apache.xerces.impl.v2.util.regex.RegularExpression;
>  import org.apache.xerces.impl.v2.SchemaSymbols;
>  /**
>   *
> @@ -73,7 +73,7 @@
>   */
> 
>  public class BooleanDatatypeValidator extends AbstractDatatypeValidator {
> -
> +
>      private static  final String    fValueSpace[]    = { "false", "true", "0", "1"};
> 
>      public BooleanDatatypeValidator () throws InvalidDatatypeFacetException {
> Index: DateTimeValidator.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/datatypes/DateTimeValidator.java,v
> retrieving revision 1.1
> diff -u -r1.1 DateTimeValidator.java
> --- DateTimeValidator.java      2001/08/24 22:26:29     1.1
> +++ DateTimeValidator.java      2001/09/06 15:15:41
> @@ -2,7 +2,7 @@
>   * The Apache Software License, Version 1.1
>   *
>   *
> - * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights
> + * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights
>   * reserved.
>   *
>   * Redistribution and use in source and binary forms, with or without
> @@ -10,7 +10,7 @@
>   * are met:
>   *
>   * 1. Redistributions of source code must retain the above copyright
> - *    notice, this list of conditions and the following disclaimer.
> + *    notice, this list of conditions and the following disclaimer.
>   *
>   * 2. Redistributions in binary form must reproduce the above copyright
>   *    notice, this list of conditions and the following disclaimer in
> @@ -18,7 +18,7 @@
>   *    distribution.
>   *
>   * 3. The end-user documentation included with the redistribution,
> - *    if any, must include the following acknowledgment:
> + *    if any, must include the following acknowledgment:
>   *       "This product includes software developed by the
>   *        Apache Software Foundation (http://www.apache.org/)."
>   *    Alternately, this acknowledgment may appear in the software itself,
> @@ -26,7 +26,7 @@
>   *
>   * 4. The names "Xerces" and "Apache Software Foundation" must
>   *    not be used to endorse or promote products derived from this
> - *    software without prior written permission. For written
> + *    software without prior written permission. For written
>   *    permission, please contact apache@apache.org.
>   *
>   * 5. Products derived from this software may not be called "Apache",
> @@ -60,7 +60,7 @@
>  import java.util.Vector;
>  import java.util.Enumeration;
>  import java.util.Hashtable;
> -import org.apache.xerces.impl.v1.util.regex.RegularExpression;
> +import org.apache.xerces.impl.v2.util.regex.RegularExpression;
>  import org.apache.xerces.impl.v2.SchemaSymbols;
> 
> 
> @@ -68,22 +68,22 @@
>   * This is the base class of all date/time datatype validators.
>   * It implements common code for parsing, validating and comparing datatypes.
>   * Classes that extend this class, must implement parse() method.
> - *
> + *
>   * @author Elena Litani
> - * @author Len Berman
> + * @author Len Berman
>   *
>   * @version $Id: DateTimeValidator.java,v 1.1 2001/08/24 22:26:29 elena Exp $
>   */
> 
>  public abstract class DateTimeValidator extends AbstractNumericFacetValidator {
> 
> -    //debugging
> +    //debugging
>      private static final boolean DEBUG=false;
> -
> +
>      //define shared variables for date/time
> 
>      //define constants
> -    protected final static int CY = 0,  M = 1, D = 2, h = 3,
> +    protected final static int CY = 0,  M = 1, D = 2, h = 3,
>      m = 4, s = 5, ms = 6, utc=7, hh=0, mm=1;
> 
>      //comparison
> @@ -91,17 +91,17 @@
>      protected static final short EQUAL=0;
>      protected static final short GREATER_THAN=1;
> 
> -    //size for all objects must have the same fields:
> +    //size for all objects must have the same fields:
>      //CCYY, MM, DD, h, m, s, ms + timeZone
>      protected final static int TOTAL_SIZE = 8;
> 
>      //date obj size for gMonth datatype (without time zone): --09--
> -    protected final static int MONTH_SIZE = 6;
> +    protected final static int MONTH_SIZE = 6;
> 
>      //date obj must have at least 6 chars after year (without time zone): "-MM-DD"
>      private final static int YEARMONTH_SIZE = 7;
> 
> -    //define constants to be used in assigning default values for
> +    //define constants to be used in assigning default values for
>      //all date/time excluding duration
>      protected final static int YEAR=2000;
>      protected final static int MONTH=01;
> @@ -114,11 +114,11 @@
>      protected int  fEnumSize;
> 
>      //size of string buffer
> -    protected int fEnd;
> +    protected int fEnd;
>      protected int fStart;
> 
> -    //storage for string value of date/time object
> -    protected StringBuffer fBuffer;
> +    //storage for string value of date/time object
> +    protected StringBuffer fBuffer;
> 
>      //obj to store all date/time objects with fields:
>      // {CY, M, D, h, m, s, ms, utc}
> @@ -139,7 +139,7 @@
> 
>      }
> 
> -    public DateTimeValidator (DatatypeValidator base, Hashtable facets, boolean derivedByList )
> +    public DateTimeValidator (DatatypeValidator base, Hashtable facets, boolean derivedByList )
>      throws InvalidDatatypeFacetException {
>          super (base, facets, derivedByList);
>      }
> @@ -147,20 +147,20 @@
>      protected void initializeValues(){
>          fDateValue = new int[TOTAL_SIZE];
>          fTempDate = new int[TOTAL_SIZE];
> -        fEnd = 30;
> +        fEnd = 30;
>          fStart = 0;
>          message = new StringBuffer(TOTAL_SIZE);
>          fBuffer = new StringBuffer(fEnd);
>          timeZone = new int[2];
>      }
> 
> -    protected void assignAdditionalFacets(String key,  Hashtable facets ) throws InvalidDatatypeFacetException{
> +    protected void assignAdditionalFacets(String key,  Hashtable facets ) throws InvalidDatatypeFacetException{
>          String msg = getErrorString(
>              DatatypeMessageProvider.fgMessageKeys[DatatypeMessageProvider.ILLEGAL_DATETIME_FACET],
>              new Object[] { key });
>          throw new InvalidDatatypeFacetException(msg);
>      }
> -
> +
>      protected int compareValues (Object value1, Object value2) {
>              return compareDates((int[])value1, (int[])value2, true);
>      }
> @@ -171,7 +171,7 @@
>      protected void setMinInclusive (String value) {
>          fMinInclusive = parse(value, null);
>      }
> -
> +
>      protected void setMaxExclusive (String value) {
>          fMaxExclusive = parse(value, null);
> 
> @@ -181,9 +181,9 @@
> 
>      }
>      protected void setEnumeration (Vector enumeration) throws InvalidDatatypeValueException{
> -
> +
>      if ( enumeration != null ) {
> -
> +
>          fEnumSize = enumeration.size();
>          fEnumeration = new int[fEnumSize][];
>          for ( int i=0; i<fEnumSize; i++ ) {
> @@ -222,7 +222,7 @@
>      /**
>       * Implemented by each subtype, calling appropriate function to parse
>       * given date/time
> -     *
> +     *
>       * @param content String value of the date/time
>       * @param date    Storage to represent date/time object.
>       *                If null - new object will be created, otherwise
> @@ -234,10 +234,10 @@
> 
>      /**
>       * Validate that a string is a W3C date/time type
> -     *
> +     *
>       * @param content string value of date/time
>       * @param state
> -     * @return
> +     * @return
>       * @exception InvalidDatatypeValueException
>       */
>      public Object validate(String content, Object state) throws InvalidDatatypeValueException{
> @@ -256,7 +256,7 @@
> 
>      /**
>       * Validates date object against facet and base datatype
> -     *
> +     *
>       * @param date    represents date/time obj
>       * @param content lexical representation of date/time obj
>       * @exception InvalidDatatypeValueException
> @@ -290,7 +290,7 @@
>              // REVISIT: output values for facets in error message
>              short c;
>              if ( fMinInclusive != null ) {
> -
> +
>                  c = compareDates(date, (int[])fMinInclusive, false);
>                  if ( c == LESS_THAN || c == INDETERMINATE ) {
>                      throw new InvalidDatatypeValueException("Value '"+content+
> @@ -329,7 +329,7 @@
>      }
>      public int compare( String content1, String content2)  {
>          //implement compareDates using the compare() method
> -        try{
> +        try{
>              parse(content1, fDateValue);
>              parse(content2,fTempDate);
>              int result = compareDates(fDateValue, fTempDate, true);
> @@ -337,7 +337,7 @@
>          }
>          catch ( RuntimeException e ) {
>              return -1;
> -
> +
>          }
>      }
> 
> @@ -351,7 +351,7 @@
>      /**
>       * Compare algorithm described in dateDime (3.2.7).
>       * Duration datatype overwrites this method
> -     *
> +     *
>       * @param date1  normalized date representation of the first value
>       * @param date2  normalized date representation of the second value
>       * @param strict
> @@ -359,7 +359,7 @@
>       */
>      protected  short compareDates(int[] date1, int[] date2, boolean strict) {
>          if ( date1[utc]==date2[utc] ) {
> -            return compareOrder(date1, date2);
> +            return compareOrder(date1, date2);
>          }
>          short c1, c2;
> 
> @@ -385,14 +385,14 @@
> 
>              if ( (c1==LESS_THAN && c2==GREATER_THAN) ||
>                   (c1==GREATER_THAN && c2==LESS_THAN) ) {
> -                return INDETERMINATE;
> +                return INDETERMINATE;
>              }
>              //REVISIT: wait for clarification on this case from schema
>              return(c1!=INDETERMINATE)?c1:c2;
>          }
>          else if ( date2[utc]=='Z' ) {
> 
> -            //compare (date1 with time zone -14)<=date2
> +            //compare (date1 with time zone -14)<=date2
>              //
>              cloneDate(date1); //clones date1 value to global temporary storage: fTempDate
>              timeZone[hh]=14;
> @@ -408,7 +408,7 @@
>                  System.out.println("date=" + dateToString(date2));
>                  System.out.println("fTempDate=" + dateToString(fTempDate));
>              }
> -            //compare (date1 with time zone +14)<=date2
> +            //compare (date1 with time zone +14)<=date2
>              //
>              cloneDate(date1); //clones date1 value to global temporary storage: fTempDate
>              timeZone[hh]=14;
> @@ -421,7 +421,7 @@
>              }
>              if ( (c1==LESS_THAN && c2==GREATER_THAN) ||
>                   (c1==GREATER_THAN && c2==LESS_THAN) ) {
> -                return INDETERMINATE;
> +                return INDETERMINATE;
>              }
>              //REVISIT: wait for clarification on this case from schema
>              return(c1!=INDETERMINATE)?c1:c2;
> @@ -434,13 +434,13 @@
>      /**
>       * Given normalized values, determines order-relation
>       * between give date/time objects.
> -     *
> +     *
>       * @param date1  date/time object
>       * @param date2  date/time object
> -     * @return
> +     * @return
>       */
>      protected short compareOrder (int[] date1, int[] date2) {
> -
> +
>          for ( int i=0;i<TOTAL_SIZE;i++ ) {
>              if ( date1[i]<date2[i] ) {
>                  return LESS_THAN;
> @@ -455,17 +455,17 @@
> 
>      /**
>       * Parses time hh:mm:ss.sss and time zone if any
> -     *
> +     *
>       * @param start
>       * @param end
>       * @param data
> -     * @return
> +     * @return
>       * @exception Exception
>       */
>      protected  void getTime (int start, int end, int[] data) throws RuntimeException{
> -
> +
>          int stop = start+2;
> -
> +
>          //get hours (hh)
>          data[h]=parseInt(start,stop);
> 
> @@ -483,7 +483,7 @@
>                  throw new RuntimeException("Error in parsing time zone" );
>          }
>          start = stop;
> -        stop = stop+2;
> +        stop = stop+2;
>          data[s]=parseInt(start,stop);
> 
>          //get miliseconds (ms)
> @@ -492,12 +492,12 @@
>          //find UTC sign if any
>          int sign = findUTCSign((milisec!=-1)?milisec:start, end);
> 
> -        //parse miliseconds
> +        //parse miliseconds
>          if ( milisec != -1 ) {
> 
>              if ( sign<0 ) {
> 
> -                //get all digits after "."
> +                //get all digits after "."
>                  data[ms]=parseInt(milisec+1,fEnd);
>              }
>              else {
> @@ -508,7 +508,7 @@
> 
>          }
> 
> -        //parse UTC time zone (hh:mm)
> +        //parse UTC time zone (hh:mm)
>          if ( sign>0 ) {
>              getTimeZone(data,sign);
>          }
> @@ -517,11 +517,11 @@
> 
>      /**
>       * Parses date CCYY-MM-DD
> -     *
> +     *
>       * @param start
>       * @param end
>       * @param data
> -     * @return
> +     * @return
>       * @exception Exception
>       */
>      protected void getDate (int start, int end, int[] date) throws RuntimeException{
> @@ -538,11 +538,11 @@
> 
>      /**
>       * Parses date CCYY-MM
> -     *
> +     *
>       * @param start
>       * @param end
>       * @param data
> -     * @return
> +     * @return
>       * @exception Exception
>       */
>      protected void getYearMonth (int start, int end, int[] date) throws RuntimeException{
> @@ -577,16 +577,16 @@
>      /**
>       * Shared code from Date and YearMonth datatypes.
>       * Finds if time zone sign is present
> -     *
> +     *
>       * @param end
>       * @param date
> -     * @return
> +     * @return
>       * @exception Exception
>       */
>      protected void parseTimeZone (int end, int[] date) throws RuntimeException{
> 
>          //fStart points right after the date
> -
> +
>          if ( fStart<fEnd ) {
>              int sign = findUTCSign(fStart, fEnd);
>              if ( sign<0 ) {
> @@ -600,10 +600,10 @@
> 
>      /**
>       * Parses time zone: 'Z' or {+,-} followed by  hh:mm
> -     *
> +     *
>       * @param data
>       * @param sign
> -     * @return
> +     * @return
>       */
>      protected void getTimeZone (int[] data, int sign) throws RuntimeException{
>          data[utc]=fBuffer.charAt(sign);
> @@ -615,21 +615,21 @@
>              return;
>          }
>          if ( sign<=(fEnd-6) ) {
> -
> +
>              //parse [hh]
>              int stop = ++sign+2;
>              timeZone[hh]=parseInt(sign, stop);
>              if (fBuffer.charAt(stop++)!=':') {
>                  throw new RuntimeException("Error in parsing time zone" );
> -            }
> -
> +            }
> +
>              //parse [ss]
>              timeZone[mm]=parseInt(stop, stop+2);
> -
> +
>              if ( stop+2!=fEnd ) {
>                  throw new RuntimeException("Error in parsing time zone");
>              }
> -
> +
>          }
>          else {
>              throw new RuntimeException("Error in parsing time zone");
> @@ -643,7 +643,7 @@
> 
>      /**
>       * Computes index of given char within StringBuffer
> -     *
> +     *
>       * @param start
>       * @param end
>       * @param ch     character to look for in StringBuffer
> @@ -660,16 +660,16 @@
> 
> 
>      /**
> -     * Validates given date/time object accoring to W3C PR Schema
> +     * Validates given date/time object accoring to W3C PR Schema
>       * [D.1 ISO 8601 Conventions]
> -     *
> +     *
>       * @param data
> -     * @return
> +     * @return
>       */
>      protected void validateDateTime (int[]  data) {
> 
>          //REVISIT: should we throw an exception for not valid dates
> -        //          or reporting an error message should be sufficient?
> +        //          or reporting an error message should be sufficient?
>          if ( data[CY]==0 ) {
>              throw new RuntimeException("The year \"0000\" is an illegal year value");
> 
> @@ -715,10 +715,10 @@
> 
>      /**
>       * Return index of UTC char: 'Z', '+', '-'
> -     *
> +     *
>       * @param start
>       * @param end
> -     * @return
> +     * @return
>       */
>      protected int findUTCSign (int start, int end) {
>          int c;
> @@ -735,14 +735,14 @@
> 
>      /**
>       * Given start and end position, parses string value
> -     *
> +     *
>       * @param value  string to parse
>       * @param start  Start position
>       * @param end    end position
>       * @return  return integer representation of characters
>       */
> -    protected  int parseInt (int start, int end)
> -    throws NumberFormatException{
> +    protected  int parseInt (int start, int end)
> +    throws NumberFormatException{
>          //REVISIT: more testing on this parsing needs to be done.
>          int radix=10;
>          int result = 0;
> @@ -776,8 +776,8 @@
>              negative = true;
>              limit = Integer.MIN_VALUE;
>              i++;
> -
> -        }
> +
> +        }
>          else{
>              limit = -Integer.MAX_VALUE;
>          }
> @@ -805,7 +805,7 @@
> 
>      /**
>       * If timezone present - normalize dateTime  [E Adding durations to dateTimes]
> -     *
> +     *
>       * @param date   CCYY-MM-DDThh:mm:ss+03
>       * @return CCYY-MM-DDThh:mm:ssZ
>       */
> @@ -827,7 +827,7 @@
>          int temp = date[m] + negate*timeZone[mm];
>          int carry = fQuotient (temp, 60);
>          date[m]= mod(temp, 60, carry);
> -
> +
>          if ( DEBUG ) {
>              System.out.println("==>carry: " + carry);
>          }
> @@ -859,14 +859,14 @@
>              date[M]=modulo(temp, 1, 13);
>              date[CY]=date[CY]+fQuotient(temp, 1, 13);
>          }
> -        date[utc]='Z';
> +        date[utc]='Z';
>      }
> 
> 
>      /**
> -     * Resets fBuffer to store string representation of
> +     * Resets fBuffer to store string representation of
>       * date/time
> -     *
> +     *
>       * @param str    Lexical representation of date/time
>       */
>      protected void resetBuffer (String str) {
> @@ -875,13 +875,13 @@
>          timeZone[hh]=timeZone[mm]=0;
>          fBuffer.append(str);
>          fEnd = fBuffer.length();
> -
> +
>      }
> 
> 
>      /**
>       * Resets object representation of date/time
> -     *
> +     *
>       * @param data   date/time object
>       */
>      protected void resetDateObj (int[] data) {
> @@ -892,12 +892,12 @@
> 
> 
>      /**
> -     * Given {year,month} computes maximum
> +     * Given {year,month} computes maximum
>       * number of days for given month
> -     *
> +     *
>       * @param year
>       * @param month
> -     * @return
> +     * @return
>       */
>      protected int maxDayInMonthFor(int year, int month) {
>          //validate days
> @@ -920,32 +920,32 @@
> 
>      private boolean isLeapYear(int year) {
> 
> -        //REVISIT: should we take care about Julian calendar?
> -        return((year%4 == 0) && ((year%100 != 0) || (year%400 == 0)));
> +        //REVISIT: should we take care about Julian calendar?
> +        return((year%4 == 0) && ((year%100 != 0) || (year%400 == 0)));
>      }
> 
>      //
>      // help function described in W3C PR Schema [E Adding durations to dateTimes]
> -    //
> +    //
>      protected int mod (int a, int b, int quotient) {
> -        //modulo(a, b) = a - fQuotient(a,b)*b
> +        //modulo(a, b) = a - fQuotient(a,b)*b
>          return (a - quotient*b) ;
>      }
> -
> +
>      //
>      // help function described in W3C PR Schema [E Adding durations to dateTimes]
>      //
>      protected int fQuotient (int a, int b) {
> -
> -        //fQuotient(a, b) = the greatest integer less than or equal to a/b
> +
> +        //fQuotient(a, b) = the greatest integer less than or equal to a/b
>          return (int)Math.floor((float)a/b);
>      }
> 
>      //
>      // help function described in W3C PR Schema [E Adding durations to dateTimes]
> -    //
> +    //
>      protected int modulo (int temp, int low, int high) {
> -        //modulo(a - low, high - low) + low
> +        //modulo(a - low, high - low) + low
>          int a = temp - low;
>          int b = high - low;
>          return (mod (a, b, fQuotient(a, b)) + low) ;
> @@ -955,8 +955,8 @@
>      // help function described in W3C PR Schema [E Adding durations to dateTimes]
>      //
>      protected int fQuotient (int temp, int low, int high) {
> -        //fQuotient(a - low, high - low)
> -
> +        //fQuotient(a - low, high - low)
> +
>          return fQuotient(temp - low, high - low);
>      }
> 
> @@ -983,7 +983,7 @@
> 
>      /**
>       * Use this function to report errors in constructor
> -     *
> +     *
>       * @param msg
>       * @param value
>       */
> Index: DecimalDatatypeValidator.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/datatypes/DecimalDatatypeValidator.java,v
> retrieving revision 1.1
> diff -u -r1.1 DecimalDatatypeValidator.java
> --- DecimalDatatypeValidator.java       2001/08/24 22:26:29     1.1
> +++ DecimalDatatypeValidator.java       2001/09/06 15:15:46
> @@ -63,7 +63,7 @@
>  import java.util.Vector;
>  import java.io.IOException;
>  import org.apache.xerces.impl.v2.SchemaSymbols;
> -import org.apache.xerces.impl.v1.util.regex.RegularExpression;
> +import org.apache.xerces.impl.v2.util.regex.RegularExpression;
> 
>  /**
>   *
> @@ -305,8 +305,8 @@
>              if (d.scale() > fFractionDigits) {
>                  String msg = getErrorString(
>                                             DatatypeMessageProvider.fgMessageKeys[DatatypeMessageProvider.FRACTION_EXCEEDED],
> -                                           new Object[] {
> -                                               "'" + content + "'" + " with fractionDigits = '"+ d.scale() +"'",
> +                                           new Object[] {
> +                                               "'" + content + "'" + " with fractionDigits = '"+ d.scale() +"'",
>                                                 "'" + fFractionDigits + "'"
>                                             });
>                  throw new InvalidDatatypeValueException(msg);
> @@ -319,8 +319,8 @@
> 
>                  String msg = getErrorString(
>                                             DatatypeMessageProvider.fgMessageKeys[DatatypeMessageProvider.TOTALDIGITS_EXCEEDED],
> -                                           new Object[] {
> -                                               "'" + content + "'" + " with totalDigits = '"+ totalDigits +"'",
> +                                           new Object[] {
> +                                               "'" + content + "'" + " with totalDigits = '"+ totalDigits +"'",
>                                                 "'" + fTotalDigits + "'"
>                                             });
>                  throw new InvalidDatatypeValueException(msg);
> Index: DoubleDatatypeValidator.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/datatypes/DoubleDatatypeValidator.java,v
> retrieving revision 1.1
> diff -u -r1.1 DoubleDatatypeValidator.java
> --- DoubleDatatypeValidator.java        2001/08/24 22:26:29     1.1
> +++ DoubleDatatypeValidator.java        2001/09/06 15:15:47
> @@ -61,7 +61,7 @@
>  import java.util.Hashtable;
>  import java.util.Vector;
>  import org.apache.xerces.impl.v2.SchemaSymbols;
> -import org.apache.xerces.impl.v1.util.regex.RegularExpression;
> +import org.apache.xerces.impl.v2.util.regex.RegularExpression;
> 
>  /**
>   * @author Elena Litani
> @@ -95,7 +95,7 @@
> 
>      }
> 
> -    protected void assignAdditionalFacets(String key,  Hashtable facets ) throws InvalidDatatypeFacetException{
> +    protected void assignAdditionalFacets(String key,  Hashtable facets ) throws InvalidDatatypeFacetException{
>          String msg = getErrorString(
>              DatatypeMessageProvider.fgMessageKeys[DatatypeMessageProvider.ILLEGAL_DOUBLE_FACET],
>              new Object[] { key});
> @@ -103,7 +103,7 @@
>      }
>      /**
>       * Compares 2 double values.
> -     *
> +     *
>       * @param value1 - Double
>       * @param value2 - Double
>       * @return value1<value2 return -1
> Index: FloatDatatypeValidator.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/datatypes/FloatDatatypeValidator.java,v
> retrieving revision 1.1
> diff -u -r1.1 FloatDatatypeValidator.java
> --- FloatDatatypeValidator.java 2001/08/24 22:26:29     1.1
> +++ FloatDatatypeValidator.java 2001/09/06 15:15:48
> @@ -61,7 +61,7 @@
>  import java.util.Hashtable;
>  import java.util.Vector;
>  import org.apache.xerces.impl.v2.SchemaSymbols;
> -import org.apache.xerces.impl.v1.util.regex.RegularExpression;
> +import org.apache.xerces.impl.v2.util.regex.RegularExpression;
>  import java.util.StringTokenizer;
>  import java.util.NoSuchElementException;
> 
> @@ -85,7 +85,7 @@
>          // Set base type
>          super (base, facets, derivedByList);
>      }
> -
> +
>     public int compare( String value1, String value2) {
>          try {
>              float f1 = fValueOf(value1).floatValue();
> @@ -98,7 +98,7 @@
>          }
>      }
> 
> -    protected void assignAdditionalFacets(String key,  Hashtable facets ) throws InvalidDatatypeFacetException{
> +    protected void assignAdditionalFacets(String key,  Hashtable facets ) throws InvalidDatatypeFacetException{
>          String msg = getErrorString(
>              DatatypeMessageProvider.fgMessageKeys[DatatypeMessageProvider.ILLEGAL_FLOAT_FACET],
>              new Object[] { key });
> @@ -111,7 +111,7 @@
>          float f2 = ((Float)value2).floatValue();
>          return compareFloats(f1, f2);
>      }
> -
> +
>      protected void setMaxInclusive (String value) {
>          fMaxInclusive = fValueOf(value);
>      }
> @@ -227,7 +227,7 @@
> 
>      protected int getInvalidFacetMsg (){
>          return DatatypeMessageProvider.ILLEGAL_FLOAT_FACET;
> -    }
> +    }
> 
>      private void enumCheck(float v, Float[] enumFloats) throws InvalidDatatypeValueException {
>          for ( int i = 0; i < enumFloats.length; i++ ) {
> Index: HexBinaryDatatypeValidator.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/datatypes/HexBinaryDatatypeValidator.java,v
> retrieving revision 1.1
> diff -u -r1.1 HexBinaryDatatypeValidator.java
> --- HexBinaryDatatypeValidator.java     2001/08/24 22:26:29     1.1
> +++ HexBinaryDatatypeValidator.java     2001/09/06 15:15:48
> @@ -62,8 +62,8 @@
>  import java.util.Vector;
>  import java.util.Enumeration;
>  import org.apache.xerces.impl.v2.SchemaSymbols;
> -import org.apache.xerces.impl.v1.util.regex.RegularExpression;
> -import org.apache.xerces.impl.v1.util.HexBin;
> +import org.apache.xerces.impl.v2.util.regex.RegularExpression;
> +import org.apache.xerces.impl.v2.util.HexBin;
> 
>  /**
>   * HexBinaryValidator validates that XML content is a W3C string type.
> @@ -74,8 +74,8 @@
>   * @version $Id: HexBinaryDatatypeValidator.java,v 1.1 2001/08/24 22:26:29 elena Exp $
>   */
>  public class HexBinaryDatatypeValidator extends AbstractStringValidator{
> -
> 
> +
>      public  HexBinaryDatatypeValidator () throws InvalidDatatypeFacetException{
>          super ( null, null, false ); // Native, No Facets defined, Restriction
> 
> @@ -84,14 +84,14 @@
>      public HexBinaryDatatypeValidator ( DatatypeValidator base, Hashtable facets,
>                                          boolean derivedByList ) throws InvalidDatatypeFacetException {
> 
> -        super (base, facets, derivedByList);
> +        super (base, facets, derivedByList);
>      }
> 
>      protected void assignAdditionalFacets(String key, Hashtable facets)  throws InvalidDatatypeFacetException{
>          String msg = getErrorString(
>              DatatypeMessageProvider.fgMessageKeys[DatatypeMessageProvider.ILLEGAL_STRING_FACET],
>              new Object[] { key });
> -        throw new InvalidDatatypeFacetException(msg);
> +        throw new InvalidDatatypeFacetException(msg);
>      }
> 
> 
> @@ -100,17 +100,17 @@
>              throw new InvalidDatatypeValueException( "Value '"+content+"' is not encoded in Hex" );
>          }
>      }
> -
> +
>      protected int getLength( String content) {
> -      int x = 0;
> -      try {
> -        x = HexBin.getDecodedDataLength(content.getBytes("utf-8"));
> -      }
> -      catch (UnsupportedEncodingException e) {
> -      }
> -      finally {
> -        return x;
> -      }
> +      int x = 0;
> +      try {
> +        x = HexBin.getDecodedDataLength(content.getBytes("utf-8"));
> +      }
> +      catch (UnsupportedEncodingException e) {
> +      }
> +      finally {
> +        return x;
> +      }
>      }
> 
> 
> Index: ListDatatypeValidator.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/datatypes/ListDatatypeValidator.java,v
> retrieving revision 1.1
> diff -u -r1.1 ListDatatypeValidator.java
> --- ListDatatypeValidator.java  2001/08/24 22:26:29     1.1
> +++ ListDatatypeValidator.java  2001/09/06 15:15:58
> @@ -2,7 +2,7 @@
>   * The Apache Software License, Version 1.1
>   *
>   *
> - * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights
> + * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights
>   * reserved.
>   *
>   * Redistribution and use in source and binary forms, with or without
> @@ -10,7 +10,7 @@
>   * are met:
>   *
>   * 1. Redistributions of source code must retain the above copyright
> - *    notice, this list of conditions and the following disclaimer.
> + *    notice, this list of conditions and the following disclaimer.
>   *
>   * 2. Redistributions in binary form must reproduce the above copyright
>   *    notice, this list of conditions and the following disclaimer in
> @@ -18,7 +18,7 @@
>   *    distribution.
>   *
>   * 3. The end-user documentation included with the redistribution,
> - *    if any, must include the following acknowledgment:
> + *    if any, must include the following acknowledgment:
>   *       "This product includes software developed by the
>   *        Apache Software Foundation (http://www.apache.org/)."
>   *    Alternately, this acknowledgment may appear in the software itself,
> @@ -26,7 +26,7 @@
>   *
>   * 4. The names "Xerces" and "Apache Software Foundation" must
>   *    not be used to endorse or promote products derived from this
> - *    software without prior written permission. For written
> + *    software without prior written permission. For written
>   *    permission, please contact apache@apache.org.
>   *
>   * 5. Products derived from this software may not be called "Apache",
> @@ -63,7 +63,7 @@
>  import java.util.StringTokenizer;
>  import java.util.NoSuchElementException;
>  import org.apache.xerces.impl.v2.SchemaSymbols;
> -import org.apache.xerces.impl.v1.util.regex.RegularExpression;
> +import org.apache.xerces.impl.v2.util.regex.RegularExpression;
> 
>  /**
>   * StringValidator validates that XML content is a W3C string type.
> @@ -73,7 +73,7 @@
>   * @version $Id: ListDatatypeValidator.java,v 1.1 2001/08/24 22:26:29 elena Exp $
>   */
>  public class ListDatatypeValidator extends AbstractDatatypeValidator{
> -
> +
>      private int        fLength           = 0;
>      private int        fMaxLength        = Integer.MAX_VALUE;
>      private int        fMinLength        = 0;
> @@ -84,10 +84,10 @@
> 
>      }
> 
> -    public ListDatatypeValidator ( DatatypeValidator base, Hashtable facets,
> +    public ListDatatypeValidator ( DatatypeValidator base, Hashtable facets,
>      boolean derivedByList ) throws InvalidDatatypeFacetException {
> 
> -        fBaseValidator = base; // Set base type
> +        fBaseValidator = base; // Set base type
> 
>          if ( facets != null  ){
>              for (Enumeration e = facets.keys(); e.hasMoreElements();) {
> @@ -103,7 +103,7 @@
>                      if ( fLength < 0 )
>                          throw new InvalidDatatypeFacetException("Length value '"+lengthValue+"'  must be a nonNegativeInteger.");
> 
> -                }
> +                }
>                  else if (key.equals(SchemaSymbols.ELT_MINLENGTH) ) {
>                      fFacetsDefined |= DatatypeValidator.FACET_MINLENGTH;
>                      String minLengthValue = (String)facets.get(key);
> @@ -112,7 +112,7 @@
>                      } catch (NumberFormatException nfe) {
>                          throw new InvalidDatatypeFacetException("maxLength value '"+minLengthValue+"' is invalid.");
>                      }
> -                }
> +                }
>                  else if (key.equals(SchemaSymbols.ELT_MAXLENGTH) ) {
>                      fFacetsDefined |= DatatypeValidator.FACET_MAXLENGTH;
>                      String maxLengthValue = (String)facets.get(key);
> @@ -121,7 +121,7 @@
>                      } catch (NumberFormatException nfe) {
>                          throw new InvalidDatatypeFacetException("maxLength value '"+maxLengthValue+"' is invalid.");
>                      }
> -                }
> +                }
>                  else if (key.equals(SchemaSymbols.ELT_ENUMERATION)) {
>                      fFacetsDefined |= DatatypeValidator.FACET_ENUMERATION;
>                      fEnumeration    = (Vector)facets.get(key);
> @@ -131,7 +131,7 @@
>                      fPattern = (String)facets.get(key);
>                      if ( fPattern != null )
>                          fRegex = new RegularExpression(fPattern, "X");
> -                }
> +                }
>                 else {
>                     String msg = getErrorString(
>                         DatatypeMessageProvider.fgMessageKeys[DatatypeMessageProvider.ILLEGAL_LIST_FACET],
> @@ -142,7 +142,7 @@
>              if (((fFacetsDefined & DatatypeValidator.FACET_LENGTH ) != 0 ) ) {
>                  if (((fFacetsDefined & DatatypeValidator.FACET_MAXLENGTH ) != 0 ) ) {
>                      throw new InvalidDatatypeFacetException(
> -                    "It is an error for both length and maxLength to be members of facets." );
> +                    "It is an error for both length and maxLength to be members of facets." );
>                  } else if (((fFacetsDefined & DatatypeValidator.FACET_MINLENGTH ) != 0 ) ) {
>                      throw new InvalidDatatypeFacetException(
>                      "It is an error for both length and minLength to be members of facets." );
> @@ -159,8 +159,8 @@
> 
>              // check 4.3.5.c0 must: enumeration values from the value space of base
>              //REVISIT: we should try either to delay it till validate() or
> -            //         store enumeration values in _value_space
> -            //         otherwise we end up creating and throwing objects
> +            //         store enumeration values in _value_space
> +            //         otherwise we end up creating and throwing objects
>              if ( base != null &&
>                  (fFacetsDefined & DatatypeValidator.FACET_ENUMERATION) != 0 &&
>                  (fEnumeration != null) ) {
> @@ -182,7 +182,7 @@
> 
>      /**
>       * validate that a string is a W3C string type
> -     *
> +     *
>       * @param content A string containing the content to be validated
>       * @param list
>       * @exception throws InvalidDatatypeException if the content is
> @@ -195,14 +195,14 @@
>              this.fBaseValidator.validate( content, state );//Passthrough setup information
>                                                            //for state validators
>          } else {
> -            checkContentEnum( content, state , null);
> +            checkContentEnum( content, state , null);
>          }
>          return null;
>      }
> 
> 
>      /**
> -     *
> +     *
>       * @return                          A Hashtable containing the facets
>       *         for this datatype.
>       */
> @@ -217,9 +217,9 @@
>          // <list> datatype
>          StringTokenizer pList1 = new StringTokenizer( value1 );
>          StringTokenizer pList2 = new StringTokenizer( value2 );
> -        int numberOfTokens = pList1.countTokens();
> +        int numberOfTokens = pList1.countTokens();
>          if (numberOfTokens < pList2.countTokens()) {
> -            return -1;
> +            return -1;
>          }
>          else if (numberOfTokens > pList2.countTokens()) {
>              return 1;
> @@ -233,7 +233,7 @@
>                          return returnValue; //REVISIT: does it make sense to return -1 or +1..?
>                      }
>                  }
> -
> +
>              }
>              return 0;
>          }
> @@ -262,8 +262,8 @@
>      }
> 
>      /**
> -     * validate that a content is valid against base datatype and facets (if any)
> -     *
> +     * validate that a content is valid against base datatype and facets (if any)
> +     *
>       * @param content A string containing the content to be validated
>       * @param state used with IDREF(s) datatypes
>       * @param enumeration enumeration facet
> @@ -272,13 +272,13 @@
>       */
>       protected void checkContentEnum( String content,  Object state, Vector enumeration )
>                                  throws InvalidDatatypeValueException {
> -
> +
>              //REVISIT: attemt to make enumeration to be validated against value space.
>              //a redesign of Datatypes might help to reduce complexity of this validation
> -
> +
>           StringTokenizer parsedList = new StringTokenizer( content );
> -         int numberOfTokens = parsedList.countTokens();
> -         if (fBaseValidator instanceof ListDatatypeValidator) {
> +         int numberOfTokens = parsedList.countTokens();
> +         if (fBaseValidator instanceof ListDatatypeValidator) {
>              //<simpleType name="fRestriction"><restriction base="fList">...</restriction></simpleType>
>              try {
>                  if ( (fFacetsDefined & DatatypeValidator.FACET_MAXLENGTH) != 0 ) {
> @@ -313,37 +313,37 @@
>                  }else {
>                      enumeration = (fEnumeration!=null) ? fEnumeration : null;
>                  }
> -
> +
>                  // enumeration must be passed till we know what "itemType" is
>                  // to be able to validate against value space
>                  ((ListDatatypeValidator)this.fBaseValidator).checkContentEnum( content, state, enumeration );
>              } catch ( NoSuchElementException e ) {
>                  e.printStackTrace();
>              }
> -        }
> -        else {
> +        }
> +        else {
>              //the case:
>              //<simpleType name="fList"><list itemType="float"/></simpleType>
> -
> +
>              if (enumeration !=null) {
> -                StringTokenizer eTokens = null; //temporary list of enumeration tokens
> +                StringTokenizer eTokens = null; //temporary list of enumeration tokens
>                  StringTokenizer cTokens = null; //list of content tokens
>                  String token= null;  //content token
>                  String eToken= null; //enumeration token
>                  boolean valid = true;
> 
> -                int eSize = enumeration.size();
> +                int eSize = enumeration.size();
>                  Vector enumTemp = new Vector(); //temporary vector to store enumeration token
>                  enumTemp.setSize(1);
>                  String currentEnumeration = null; //enum value: <enumeration value="1 2 3"/>
> -
> +
>                  for (int i=0;i<eSize;i++) { //loop through each enumeration
>                      currentEnumeration = (String)enumeration.elementAt(i);
>                      eTokens = new StringTokenizer (currentEnumeration);
>                      valid = true;
> 
>                      cTokens = (i==0)?parsedList:new StringTokenizer( content );
> -
> +
>                      if (numberOfTokens == eTokens.countTokens()) {
>                          try {
>                              //try string comparison first
> @@ -361,7 +361,7 @@
>                                      //REVISIT: date/time enumeration support
>                                      if (fBaseValidator instanceof AbstractNumericValidator) {
>                                          ((AbstractNumericValidator)fBaseValidator).checkContentEnum(token, state, enumTemp);
> -                                    } else {
> +                                    } else {
>                                          if (!token.equals(eToken)) { //validate enumeration for all other types
>                                              throw new InvalidDatatypeValueException("Value '"+content+ "' must be one of "+enumeration);
>                                          }
> @@ -403,14 +403,14 @@
>      * @param enumeration facet
>      *
>      * @returns true if enumeration is subset of fEnumeration, false otherwise
> -    */
> +    */
>      private boolean verifyEnum (Vector enum){
> 
>          /* REVISIT: won't work for list datatypes in some cases: */
>          if ((fFacetsDefined & DatatypeValidator.FACET_ENUMERATION ) != 0) {
>              for (Enumeration e = enum.elements() ; e.hasMoreElements() ;) {
>                  if (fEnumeration.contains(e.nextElement()) == false) {
> -                    return false;
> +                    return false;
>                  }
>              }
>          }
> Index: StringDatatypeValidator.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/datatypes/StringDatatypeValidator.java,v
> retrieving revision 1.1
> diff -u -r1.1 StringDatatypeValidator.java
> --- StringDatatypeValidator.java        2001/08/24 22:26:29     1.1
> +++ StringDatatypeValidator.java        2001/09/06 15:15:59
> @@ -63,7 +63,7 @@
>  import java.util.Locale;
>  import java.text.Collator;
>  import org.apache.xerces.impl.v2.SchemaSymbols;
> -import org.apache.xerces.impl.v1.util.regex.RegularExpression;
> +import org.apache.xerces.impl.v2.util.regex.RegularExpression;
> 
>  /**
>   * StringValidator validates that XML content is a W3C string type.
> @@ -84,8 +84,8 @@
>      public StringDatatypeValidator ( DatatypeValidator base, Hashtable facets,
>                                       boolean derivedByList ) throws InvalidDatatypeFacetException {
> 
> -        super (base, facets, derivedByList);
> -
> +        super (base, facets, derivedByList);
> +
>      }
> 
> 
> @@ -100,7 +100,7 @@
>                  fWhiteSpace = DatatypeValidator.PRESERVE;
>              }
>              else if ( ws.equals(SchemaSymbols.ATTVAL_REPLACE) ) {
> -
> +
>                  fWhiteSpace = DatatypeValidator.REPLACE;
>              }
>              else if ( ws.equals(SchemaSymbols.ATTVAL_COLLAPSE) ) {
> @@ -137,12 +137,12 @@
>          // check 4.3.6.c1 error:
>          // (whiteSpace = preserve || whiteSpace = replace) && base.whiteSpace = collapese or
>          // whiteSpace = preserve && base.whiteSpace = replace
> -
> +
>          if ( (fFacetsDefined & DatatypeValidator.FACET_WHITESPACE) != 0 &&
>               (((StringDatatypeValidator)fBaseValidator).fFacetsDefined & DatatypeValidator.FACET_WHITESPACE) != 0 ) {
>                          if ( (((StringDatatypeValidator)fBaseValidator).fFlags & DatatypeValidator.FACET_WHITESPACE) != 0 &&
>                           fWhiteSpace != ((StringDatatypeValidator)fBaseValidator).fWhiteSpace ) {
> -                        throw new InvalidDatatypeFacetException( "whiteSpace value = '" + whiteSpaceValue(fWhiteSpace) +
> +                        throw new InvalidDatatypeFacetException( "whiteSpace value = '" + whiteSpaceValue(fWhiteSpace) +
>                                                                   "' must be equal to base.whiteSpace value = '" +
>                                                                   whiteSpaceValue(((StringDatatypeValidator)fBaseValidator).fWhiteSpace) + "' with attribute {fixed} = true" );
>              }
> @@ -173,7 +173,7 @@
>      }
> 
>      private String whiteSpaceValue (short ws){
> -       return (ws != DatatypeValidator.PRESERVE)?
> +       return (ws != DatatypeValidator.PRESERVE)?
>                (ws == DatatypeValidator.REPLACE)?"replace":"collapse":"preserve";
>      }
>      /**
> Index: UnionDatatypeValidator.java
> ===================================================================
> RCS file: /home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/v2/datatypes/UnionDatatypeValidator.java,v
> retrieving revision 1.1
> diff -u -r1.1 UnionDatatypeValidator.java
> --- UnionDatatypeValidator.java 2001/08/24 22:26:29     1.1
> +++ UnionDatatypeValidator.java 2001/09/06 15:16:01
> @@ -2,7 +2,7 @@
>   * The Apache Software License, Version 1.1
>   *
>   *
> - * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights
> + * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights
>   * reserved.
>   *
>   * Redistribution and use in source and binary forms, with or without
> @@ -10,7 +10,7 @@
>   * are met:
>   *
>   * 1. Redistributions of source code must retain the above copyright
> - *    notice, this list of conditions and the following disclaimer.
> + *    notice, this list of conditions and the following disclaimer.
>   *
>   * 2. Redistributions in binary form must reproduce the above copyright
>   *    notice, this list of conditions and the following disclaimer in
> @@ -18,7 +18,7 @@
>   *    distribution.
>   *
>   * 3. The end-user documentation included with the redistribution,
> - *    if any, must include the following acknowledgment:
> + *    if any, must include the following acknowledgment:
>   *       "This product includes software developed by the
>   *        Apache Software Foundation (http://www.apache.org/)."
>   *    Alternately, this acknowledgment may appear in the software itself,
> @@ -26,7 +26,7 @@
>   *
>   * 4. The names "Xerces" and "Apache Software Foundation" must
>   *    not be used to endorse or promote products derived from this
> - *    software without prior written permission. For written
> + *    software without prior written permission. For written
>   *    permission, please contact apache@apache.org.
>   *
>   * 5. Products derived from this software may not be called "Apache",
> @@ -63,7 +63,7 @@
>  import java.util.StringTokenizer;
>  import java.util.NoSuchElementException;
>  import org.apache.xerces.impl.v2.SchemaSymbols;
> -import org.apache.xerces.impl.v1.util.regex.RegularExpression;
> +import org.apache.xerces.impl.v2.util.regex.RegularExpression;
> 
> 
> 
> @@ -74,11 +74,11 @@
>   * Implements the September 22 XML Schema datatype Union Datatype type
>   */
>  public class UnionDatatypeValidator extends AbstractDatatypeValidator {
> -
> +
>      private Vector  fBaseValidators   = null; // union collection of validators
>      private int fValidatorsSize = 0;
>      private Vector     fEnumeration      = null;
> -    private StringBuffer errorMsg = null;
> +    private StringBuffer errorMsg = null;
> 
> 
>      public  UnionDatatypeValidator () throws InvalidDatatypeFacetException{
> @@ -88,7 +88,7 @@
> 
> 
>      public UnionDatatypeValidator ( DatatypeValidator base, Hashtable facets, boolean derivedBy ) throws InvalidDatatypeFacetException {
> -        fBaseValidator = base;
> +        fBaseValidator = base;
>          //facets allowed are: pattern & enumeration
>          if ( facets != null ) {
>              for ( Enumeration e = facets.keys(); e.hasMoreElements(); ) {
> @@ -144,7 +144,7 @@
> 
>      /**
>       * validate that a string is a W3C string type
> -     *
> +     *
>       * @param content A string containing the content to be validated
>       * @param list
>       * @exception throws InvalidDatatypeException if the content is
> @@ -165,7 +165,7 @@
> 
> 
>      /**
> -     *
> +     *
>       * @return A Hashtable containing the facets
>       *         for this datatype.
>       */
> @@ -180,7 +180,7 @@
>          //union datatype
>          int index=-1;
>          DatatypeValidator currentDV;
> -        while ( ++index < fValidatorsSize ) {
> +        while ( ++index < fValidatorsSize ) {
>              currentDV =  (DatatypeValidator)this.fBaseValidators.elementAt(index);
>              if (currentDV.compare(value1, value2) == 0) {
>                  return  0;
> @@ -199,7 +199,7 @@
>              newObj = new UnionDatatypeValidator();
>              newObj.fLocale           =  this.fLocale;
>              newObj.fBaseValidator    =  this.fBaseValidator;
> -            newObj.fBaseValidators   =  (Vector)this.fBaseValidators.clone();
> +            newObj.fBaseValidators   =  (Vector)this.fBaseValidators.clone();
>              newObj.fPattern          =  this.fPattern;
>              newObj.fEnumeration      =  this.fEnumeration;
>              newObj.fFacetsDefined    =  this.fFacetsDefined;
> @@ -231,7 +231,7 @@
>          if ((fFacetsDefined & DatatypeValidator.FACET_ENUMERATION ) != 0) {
>              for (Enumeration e = enum.elements() ; e.hasMoreElements() ;) {
>                  if (fEnumeration.contains(e.nextElement()) == false) {
> -                    return false;
> +                    return false;
>                  }
>              }
>          }
> @@ -239,8 +239,8 @@
>      }
> 
>      /**
> -     * validate if the content is valid against base datatype and facets (if any)
> -     *
> +     * validate if the content is valid against base datatype and facets (if any)
> +     *
>       * @param content A string containing the content to be validated
>       * @param pattern: true if pattern facet was applied, false otherwise
>       * @param enumeration enumeration facet
> @@ -253,7 +253,7 @@
>          // pass @param enumeration so that when base Datatype is known, we would validate enumeration/content
>          // against value space as well
>          int index = -1; //number of validators
> -        boolean valid=false;
> +        boolean valid=false;
>          DatatypeValidator currentDV = null;
>          if (fBaseValidator !=null) {  //restriction  of union datatype
>              if ( (fFacetsDefined & DatatypeValidator.FACET_PATTERN ) != 0 ) {
> @@ -276,7 +276,7 @@
>              return;
>          }
>          // native union type
> -        while ( ++index < fValidatorsSize) {
> +        while ( ++index < fValidatorsSize) {
>              // check content against each base validator in Union
>              // report an error only in case content is not valid against all base datatypes.
>              currentDV =  (DatatypeValidator)this.fBaseValidators.elementAt(index);
> @@ -284,7 +284,7 @@
>              try {
>                  if ( currentDV instanceof ListDatatypeValidator ) {
>                      if ( pattern ) {
> -                        throw new InvalidDatatypeValueException("Facet \"Pattern\" can not be applied to a list datatype" );
> +                        throw new InvalidDatatypeValueException("Facet \"Pattern\" can not be applied to a list datatype" );
>                      }
>                      ((ListDatatypeValidator)currentDV).checkContentEnum( content, state, enumeration );
>                  }
> @@ -302,7 +302,7 @@
>                                  throw new InvalidDatatypeValueException("Value '"+content+ "' must be one of "+ enumeration);
>                              }
>                              ((DatatypeValidator)currentDV).validate( content, state );
> -                        }
> +                        }
>                      }
>                      else {
>                          ((DatatypeValidator)currentDV).validate( content, state );
> @@ -315,7 +315,7 @@
>              }
>          }
>          if ( !valid ) {
> -            throw new InvalidDatatypeValueException( "Content '"+content+"' does not match any union types" );
> +            throw new InvalidDatatypeValueException( "Content '"+content+"' does not match any union types" );
>          }
>      }
> 
> 
>   ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org