<xs:restriction> incorrectly validates the <xs:minInclusive> value against the 
lexical space instead of the value space.
------------------------------------------------------------------------------------------------------------------------

         Key: XERCESJ-1096
         URL: http://issues.apache.org/jira/browse/XERCESJ-1096
     Project: Xerces2-J
        Type: Bug
  Components: XML Schema API, XML Schema datatypes  
    Versions: 2.5.0, 2.6.2, 2.7.1    
 Environment: IBM JDK 1.4.2_01
Eclipse 3.0.2
Windows XP
 Reporter: Derek Mahar


<xs:restriction> incorrectly validates the <xs:minInclusive> value against the 
lexical space as constrained by <xs:pattern> instead of the value space. This 
issue is very similar to XERCESJ-962.

Schema fragment:

<xs:simpleType name="CurrencyType">
  <xs:restriction base="xs:decimal">
    <xs:minInclusive value="0"/>
      <xs:fractionDigits value="2"/>
      <xs:pattern value="(([1-9][0-9]*)|0?)\.[0-9]{2}"/>
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="AmountType">
  <xs:restriction base="CurrencyType"/>
</xs:simpleType>

<xs:element name="grossAmount" type="AmountType"/>

Input element:

<grossAmount>0.11</grossAmount>

Result:

Caused by: [TIAFSchemaValidationException: error = Schema validation error: 
Error on line 150 of document jcp:com/msdw/taxwith/ecr/validation/revolver.xsd: 
cvc-pattern-valid: Value '0' is not facet-valid with respect to pattern 
'(([1-9][0-9]*)|0?)\.[0-9]{2}' for type 'CurrencyType'.]

Library TIAF uses Xerces to validate an XML document against the schema, 
revolver.xsd.

To workaround this problem, I've changed 'minInclusive' from '0' to '0.00'.

-- 
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