Issue 18786: Canonical XMI should mandate use of Canonical Lexical Representation for XML (canonical-xmi-ftf) Source: Adaptive (Mr. Pete Rivett, pete.rivett(at)adaptive.com) Nature: Uncategorized Issue Severity: Summary: Detail: XML allows a number of serialization options ? for example xs:booleann may be serialized as “0” and “1” in addition to “false” and “true”. However the XSD spec does define a Canonical Lexical Representation that removes this variability: see http://www.w3.org/TR/xmlschema-2/#canonical-lexical-representation This should be mandated by the Canonical XMI Spec. Resolution: Implement the suggestion Revised Text: Add a new numbered rule to the end of section B2: All data values must use the XML Canonical Lexical Representation as defined at: http://www.w3.org/TR/xmlschema-2/#canonical-lexical-representation . That means, for example, that boolean values must be represented as “true” or “false” and not “1” or “0”. Actions taken: July 1, 2013: received issue December 23, 2013: closed issue Discussion: End of Annotations:===== ubject: RE: XMI serialization of Booleans as "0" and "1"? Date: Mon, 1 Jul 2013 17:11:24 -0700 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: XMI serialization of Booleans as "0" and "1"? Thread-Index: Ac52bm84eZNgwQsbRHiI7GkDOEOBwAASVdUA From: "Pete Rivett" To: "Juergen Boldt" X-Virus-Scanned: amavisd-new at omg.org Here.s the issue, against Canonical XMI Spec Title: Canonical XMI should mandate use of Canonical Lexical Representation for XML Detail: XML allows a number of serialization options . for example xs:booleann may be serialized as .0. and .1. in addition to .false. and .true.. However the XSD spec does define a Canonical Lexical Representation that removes this variability: see http://www.w3.org/TR/xmlschema-2/#canonical-lexical-representation This should be mandated by the Canonical XMI Spec. From: Juergen Boldt [mailto:juergen@omg.org] Sent: Monday, July 01, 2013 8:20 AM To: Pete Rivett Subject: Re: XMI serialization of Booleans as "0" and "1"? issue? At 08:32 PM 6/26/2013, you wrote: This came up in a review of a SBVR XMI model file which is an instance of the SBVR metamodel (expressed in CMOF). However this discussion applies to all UML models In the model in question an attribute declared as of type Boolean is serialized with values 0 and 1 as opposed to false and true. Initially I assumed this was wrong but after looking further Im not so sure Although the UML spec says that valid values for Boolean are true and false, in the UML metamodel the XSD datatype associated with the PrimitiveType Boolean is xs:boolean. And that datatype allows serialization of 1 and 0 as well as true and false: http://www.w3.org/TR/xmlschema-2/#boolean states An instance of a datatype that is defined as boolean can have the following legal literals {true, false, 1, 0}. http://www.w3.org/TR/xmlschema-2/#boolean So although Boolean has the logical values true and false it seems there are options for how the values may be serialized. Any comment? If this is valid its probably an option that should be eliminated in the Canonical XMI spec. BTW out of curiosity I edited the MIWG TC1 valid.xmi file to replace isAbstract=true by isAbstract=1 and submitted to the NIST Validator. I got the error Missing mandatory value so the Validator would also need to be changed. -- Pete Juergen Boldt Director, Member Services 109 Highland Ave Needham, MA 02494 USA Tel: 781 444 0404 x 132 fax: 781 444 0320 www.omg.org []