[ 
http://issues.apache.org/jira/browse/XERCESJ-962?page=comments#action_66814 ]
     
Sandy Gao commented on XERCESJ-962:
-----------------------------------

I agree that the spec isn't as clear as it could be, but I think it's *implied* 
that lexical reps for facet values have to be valid.

When a "minInclusive" facet is encountered, in your case with the lexical value 
"5", the parser needs to turn that into an actual value. The only prescribed 
way in the spec to do so is to validate the lexical value. Because your "5" 
isn't in the lexical space of "base", "base" doesn't know how to convert "5" to 
an actual value. The result is that the parser can't correctly compute the 
value of a facet, hence the schema has to be flagged invalid.

One thing worth mentioning is that you seem to imply that pattern matching 
happens *after* you get your actual value (an integer 5). But what actually 
happens is that patterns are checked *when* you convert from "5" to integer 5.

> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to