You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2002/03/21 18:07:38 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/dv/xs MonthDV.java AbstractDateTimeDV.java

sandygao    02/03/21 09:07:38

  Modified:    java/src/org/apache/xerces/impl/dv/xs MonthDV.java
                        AbstractDateTimeDV.java
  Log:
  Change the lexical representation of gMonth from --MM-- to --MM. This is an erratum of the schema spec.
  
  Revision  Changes    Path
  1.4       +3 -9      xml-xerces/java/src/org/apache/xerces/impl/dv/xs/MonthDV.java
  
  Index: MonthDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/MonthDV.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MonthDV.java	29 Jan 2002 01:15:12 -0000	1.3
  +++ MonthDV.java	21 Mar 2002 17:07:38 -0000	1.4
  @@ -66,7 +66,7 @@
    * @author Elena Litani
    * @author Gopal Sharma, SUN Microsystem Inc.
    *
  - * @version $Id: MonthDV.java,v 1.3 2002/01/29 01:15:12 lehors Exp $
  + * @version $Id: MonthDV.java,v 1.4 2002/03/21 17:07:38 sandygao Exp $
    */
   
   public class MonthDV extends AbstractDateTimeDV {
  @@ -88,7 +88,7 @@
       /**
        * Parses, validates and computes normalized version of gMonth object
        *
  -     * @param str    The lexical representation of gMonth object --MM--
  +     * @param str    The lexical representation of gMonth object --MM
        *               with possible time zone Z or (-),(+)hh:mm
        * @param date   uninitialized date object
        * @return normalized date representation
  @@ -96,7 +96,6 @@
        */
       protected int[] parse(String str, int[] date) throws SchemaDateTimeException{
   
  -        //REVISIT: change --MM-- to --MM
           resetBuffer(str);
   
           //create structure to hold an object
  @@ -114,9 +113,6 @@
           int stop = fStart +4;
           date[M]=parseInt(fStart+2,stop);
   
  -        if (fBuffer.charAt(stop++)!='-' || fBuffer.charAt(stop)!='-') {
  -            throw new SchemaDateTimeException("Invalid format for gMonth: "+str);
  -        }
           if ( MONTH_SIZE<fEnd ) {
               int sign = findUTCSign(MONTH_SIZE, fEnd);
               if ( sign<0 ) {
  @@ -181,7 +177,7 @@
        * Converts month object representation to String
        *
        * @param date   month object
  -     * @return lexical representation of month: --MM-- with an optional time zone sign
  +     * @return lexical representation of month: --MM with an optional time zone sign
        */
       protected String dateToString(int[] date) {
   
  @@ -189,8 +185,6 @@
           message.append('-');
           message.append('-');
           message.append(date[M]);
  -        message.append('-');
  -        message.append('-');
           message.append((char)date[utc]);
           return message.toString();
       }
  
  
  
  1.4       +3 -3      xml-xerces/java/src/org/apache/xerces/impl/dv/xs/AbstractDateTimeDV.java
  
  Index: AbstractDateTimeDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/AbstractDateTimeDV.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractDateTimeDV.java	29 Jan 2002 01:15:12 -0000	1.3
  +++ AbstractDateTimeDV.java	21 Mar 2002 17:07:38 -0000	1.4
  @@ -74,7 +74,7 @@
    * @author Len Berman
    * @author Gopal Sharma, SUN Microsystems Inc.
    *
  - * @version $Id: AbstractDateTimeDV.java,v 1.3 2002/01/29 01:15:12 lehors Exp $
  + * @version $Id: AbstractDateTimeDV.java,v 1.4 2002/03/21 17:07:38 sandygao Exp $
    */
   public abstract class AbstractDateTimeDV extends TypeValidator {
   
  @@ -91,8 +91,8 @@
       //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;
  +    //date obj size for gMonth datatype (without time zone): --09
  +    protected final static int MONTH_SIZE = 4;
   
       //date obj must have at least 6 chars after year (without time zone): "-MM-DD"
       private final static int YEARMONTH_SIZE = 7;
  
  
  

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