getLexicalFacetValue returns wrong total digits for integer validation
----------------------------------------------------------------------

         Key: XERCESJ-1071
         URL: http://issues.apache.org/jira/browse/XERCESJ-1071
     Project: Xerces2-J
        Type: Bug
  Components: XML Schema API  
    Versions: 2.6.2    
 Environment: Win2K, 
    Reporter: Kurt Riede
    Priority: Minor
 Attachments: patch.txt

If I call

        getLexicalFacetValue(XSSimpleTypeDefinition.FACET_TOTALDIGITS)

on the integer type and types derivated from integer, I always get "0".
Getting the total digit facet via getFacets() returns undefined as expected. 

It seems that in class XSSimpleTypeDecl in method getLexicalFacetValue, the 
test for validationDV == DV_INTEGER was by mistake placed in the case 
FACET_TOTALDIGITS instead of the case FACET_FRACTIONDIGITS.

Index: XSSimpleTypeDecl.java
===================================================================
RCS file: 
/home/cvspublic/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java,v
retrieving revision 1.68
diff -u -r1.68 XSSimpleTypeDecl.java
--- XSSimpleTypeDecl.java       7 Apr 2005 17:37:07 -0000       1.68
+++ XSSimpleTypeDecl.java       28 Apr 2005 07:17:31 -0000
@@ -2067,10 +2067,10 @@
                case FACET_MININCLUSIVE:
                        return (fMinInclusive == 
null)?null:fMinInclusive.toString();
                case FACET_TOTALDIGITS:
-                       if (fValidationDV == DV_INTEGER)
-                               return "0";
                        return (fTotalDigits == 
-1)?null:Integer.toString(fTotalDigits);
                case FACET_FRACTIONDIGITS:
+            if (fValidationDV == DV_INTEGER)
+                return "0";
                        return (fFractionDigits == 
-1)?null:Integer.toString(fFractionDigits);
                }
                return null;


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to