You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Derek Mahar (JIRA)" <xe...@xml.apache.org> on 2005/08/31 16:33:10 UTC

[jira] Commented: (XERCESJ-962) minInclusive facet validated against lexical space, not value space

    [ http://issues.apache.org/jira/browse/XERCESJ-962?page=comments#action_12320696 ] 

Derek Mahar commented on XERCESJ-962:
-------------------------------------

I found a closely related test case that still manifests this problem in 2.5, 2.6.2, and 2.7.1:

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

Should we create a new issue for this problem or re-open this issue?

Derek

> minInclusive facet validated against lexical space, not value space
> -------------------------------------------------------------------
>
>          Key: XERCESJ-962
>          URL: http://issues.apache.org/jira/browse/XERCESJ-962
>      Project: Xerces2-J
>         Type: Bug
>   Components: XML Schema API
>     Versions: 2.6.2
>     Reporter: David Sheldon
>     Assignee: Sandy Gao
>      Fix For: 2.6.2
>  Attachments: a.xsd, new-a.xsd
>
> If I have a type thus:
>  <xsd:element name='Reason'>
>     <xsd:simpleType>
>       <xsd:restriction base='xsd:integer'>
>         <xsd:pattern value='[0-9][0-9]' />
>         <xsd:maxInclusive value='29' />
>         <xsd:minInclusive value='5' />
>       </xsd:restriction>
>     </xsd:simpleType>
>   </xsd:element>
> I get the error message:
>     cvc-pattern-valid: Value '5' is not facet-valid with respect to pattern '[0-9][0-9]' for type 'null'.
> 5 is from the value space of "integer". It appears that xerces is checking the Value '5' against the lexical space of the derived type.
> The spec: http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dc-minInclusive
> Says: 
> A value from the - value space-  of the {base type definition}.

-- 
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: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org