esdscom / sdscom-xml

Schema definition and other documents of eSDScom (formerly SDScom and ESCom), the standard for electronic exchange of Safety Data Sheets in a structured, processible way across Europe and other regions. Please read the wiki for more info. All work is licensed under CC BY-ND 4.0 (https://creativecommons.org/licenses/by-nd/4.0/legalcode)
https://www.esdscom.eu
27 stars 6 forks source link

Usage of SimpleType "int16" for MultiplyingFactor #224

Closed joern-epos closed 4 years ago

joern-epos commented 4 years ago

The FactorValue at the MultiplyingFactor had the type "int20" in SDSCom 4.2.3. "int20" is an a positive integer number with 1 to 20 digits.

Now in SDSCom 4.4.0(.1) the FactorValue at the MultiplyingFactor is the type "int16". "int16" is a positive integer number with 16 digits.

The usage of an integer with exactly 16 digits for an value which have a maximum number of 5 or 6 digits is not very useful.

There are two opportunities. One would be to change the definition of "int16" to a integer with 1 to 16 digits. This should be possible because there is no other occurrence for this type than in the MultiplyingFactor. Maybe this is an undiscovered error since the first SDSCom version. Before SDSCom 4.4.0 was no usage of this type.

The second opportunity would be to change the FactorValue back to the type "int20".

dirk-qualisys commented 4 years ago

int16 is indeed currently defined as [0-9]{16} while int20 is [0-9]{1,20} - the definitions are correctly described in the annotations, so that is no mistake, but it certainly does not fit the needs of a multiplying factor. As this is the only use of int16, I suggest to delete it and replace it by a specific type "MultiplyingFactorInt" defined as 10{1,8} so that the string allows only powers of 10. That needs to go into the LTE version as well, since we have a bug here. OK?

nils-eska commented 4 years ago

This is OK for me. I will add this to LTE Version 4.4.0.2

joern-epos commented 4 years ago

I think also that this is a bug which should be fixed for the LTE version. Thanks.

dirk-qualisys commented 4 years ago

Changed the proposed definition to cover 1 as a multiplying factor, i.e. allow for zero 0's:

    <xs:simpleType name="MultiplyingFactorInt">
        <xs:annotation>
            <xs:documentation>A positive integer that covers powers of 10.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:pattern value="10{0,8}"/>
        </xs:restriction>
    </xs:simpleType>