sandygao 2002/08/20 16:03:21
Modified: java/src/org/apache/xerces/impl/dv/xs
AbstractDateTimeDV.java MonthDV.java
Log:
Allow both --MM-- and --MM as valid gMonth representations.
We'll remove the support for --MM-- when the erratum is officially in the rec.
Revision Changes Path
1.6 +1 -4
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.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AbstractDateTimeDV.java 26 Apr 2002 20:33:49 -0000 1.5
+++ AbstractDateTimeDV.java 20 Aug 2002 23:03:20 -0000 1.6
@@ -91,9 +91,6 @@
//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 = 4;
-
//define constants to be used in assigning default values for
//all date/time excluding duration
protected final static int YEAR=2000;
1.7 +10 -3 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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- MonthDV.java 18 Jul 2002 20:48:43 -0000 1.6
+++ MonthDV.java 20 Aug 2002 23:03:21 -0000 1.7
@@ -108,8 +108,15 @@
int stop = 4;
date[M]=parseInt(str,2,stop);
- if ( MONTH_SIZE<len ) {
- int sign = findUTCSign(str, MONTH_SIZE, len);
+ // REVISIT: allow both --MM and --MM-- now.
+ // need to remove the following 4 lines to disallow --MM--
+ // when the errata is offically in the rec.
+ if (str.length() >= stop+2 &&
+ str.charAt(stop) == '-' && str.charAt(stop+1) == '-') {
+ stop += 2;
+ }
+ if (stop < len) {
+ int sign = findUTCSign(str, stop, len);
if ( sign<0 ) {
throw new SchemaDateTimeException ("Error in month parsing: "+str);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]