Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1071

getLexicalFacetValue returns wrong total digits for integer validation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.6.2
    • None
    • XML Schema API
    • None
    • Win2K,

    Description

      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;

      Attachments

        1. patch.txt
          0.8 kB
          Kurt Riede

        Activity

          People

            Unassigned Unassigned
            kriede Kurt Riede
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: