[ http://issues.apache.org/jira/browse/XERCESJ-1056?page=comments#action_12356386 ]
Jean-Jacques Thomasson commented on XERCESJ-1056: ------------------------------------------------- I want to tell Michael that I do not agree with his analysis of the problem because he is refering to the canonical space only and not to the lexical space. Let me explain : A parser should produce the canonical lexical form only after having transformed the lexical form (the XML document read from a file) into valid values (in the value space). Since 0 and 1 (of an xs:boolean type) are transformed into true or false in the value space, the parser should normally write true or false in the canonical lexical space. Limiting the booleean type to 0 and 1 in the lexical space do not mean that we want to enforce the use of 0 and 1 in the canonincal lexical space. In section 4.3.4 of the W3C recommendation, it is clearly stated that xs:pattern is "a constraint on the value space which is achieved in constraining the lexical space to litterals which match a specific pattern". In Jérôme's case, he do not put any new limit to the value space but just put constraint on the lexical space. In the case, the limitation of the lexical space will just not change the possible values of the boolean in the value space. Is that forbidden by the recommandation ? No. It is acceptable to say that we may want to limit the lexical values of a boolean to be 0 or 1 however those values will be transformed to true and false in the canonical space. Why ? Because most applications do not work on the resulting canonical lexical space but directly by reading the original XML document (the lexical space). Otherwise, the use of pattern on a boolean would just be a limit o one of the two values (true or false) which, in that case, would just be a fixed value ! Jean-Jacques Thomasson (Translator of XML-Schema W3C standard, translotor of Eric van der Vlist book O'Reilly and Author of XML Schéma at Eyrolles) > Error while validating a simple type with pattern facet and value constraint > ---------------------------------------------------------------------------- > > Key: XERCESJ-1056 > URL: http://issues.apache.org/jira/browse/XERCESJ-1056 > Project: Xerces2-J > Type: Bug > Components: XML Schema Structures > Versions: 2.6.2 > Environment: PC, Linux Red Hat 7.1 > Reporter: Jérôme LEMOYNE > > the following schema can not be validated by Xerces : > <?xml version="1.0" encoding="UTF-8"?> > <xs:schema targetNamespace="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:xs="http://www.w3.org/2001/XMLSchema"> > <xs:attribute name="root" default="0"> > <xs:simpleType> > <xs:restriction base="xs:boolean"> > <xs:pattern value="0|1"/> > </xs:restriction> > </xs:simpleType> > </xs:attribute> > </xs:schema> > Its validation results in the following error messages : > Error:(file:/bug.xsd:Line.6,Col.41)a-props-correct.2: Invalid value > constraint value '0' in attribute 'root'. > Error:(file:/bug.xsd:Line.6,Col.41)cvc-pattern-valid: Value 'false' is not > facet-valid with respect to pattern '0|1' for type 'null'. -- 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]
