[ 
https://issues.apache.org/jira/browse/XERCESJ-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14157768#comment-14157768
 ] 

Mukul Gandhi commented on XERCESJ-1646:
---------------------------------------

I agree that this doesn't look like a bug against the spec. It seems the 
desired behavior should have been specified in one of these sections of the 
spec,
"Constraints on XML Representations of Simple Type Definitions" or "Constraints 
on Simple Type Definition Schema Components" (looking at XSD 1.1 spec). But I 
don't see such a requirement in the spec. Xerces while validating an XML 
instance document, considers the facets xsd:maxLength and xsd:enumeration 
correctly (but doesn't establish a relation between xsd:maxLength and 
xsd:enumeration before validation) and doesn't seem to cause any loss of 
functionality. If we attempt to mimic Saxon's functionality as reported, we 
need to consider all cases where enumeration and {length, minLength, maxLength} 
facets have relation.

I would prefer to leave the implementation as its now for this bug, looking at 
all pros and cons. If the reported feature is still desired, it may be 
reclassified as Wish or Improvement.

> Error not reported when the maxLength limit is exceeded in an enumeration
> -------------------------------------------------------------------------
>
>                 Key: XERCESJ-1646
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1646
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Structures
>    Affects Versions: 2.11.0
>            Reporter: Octavian Nadolu
>            Priority: Trivial
>
> If the maxLength limit is exceeded in an enumeration, Xerces engine does not 
> report this error. 
> If I use Saxon engine I get en warning message: 
> "Enumeration value "REQUESTED_CHARGE" is not a valid instance of the type: it 
> contravenes the maxLength facet"
> You can find below a sample schema. I tested on the xml-schema-1.1-dev branch.
> {code:xml}
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>     <xsd:simpleType name="PaymentStatus">
>         <xsd:restriction base="xsd:string">
>             <xsd:maxLength value="15"/>
>             <xsd:enumeration value="AWAIT_PAY_INFO"/>
>             <xsd:enumeration value="AWAIT_AUTH"/>
>             <xsd:enumeration value="REQUESTED_AUTH"/>
>             <xsd:enumeration value="REQUESTED_CHARGE"/>
>             <xsd:enumeration value="PAID"/>
>         </xsd:restriction>
>     </xsd:simpleType> 
> </xsd:schema>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to