G
goldfrapper
H,
If have been searching for a while, without finding, for a way to
restrict a datatype from a certain basetype by relation instead of
strict restriction.
For example: (in the metric system) to relate a datatype named kilogram
to gram or liter to mililiter.
This would make it possible to move between related datatypes.
Say where given a two values: 1.5 kilogram and 500 gram and we need to
count them as one value.
If we would 'know' that 1000 gram is equal to 1 kilogram we could do
the math.
This could be done by optional facets like:
<xs:simpleType name="gram">
<xs:restriction base="xs:decimal"></xs:restriction>
</xs:simpleType>
<xs:simpleType name="kilogram">
<xs:restriction base="xs:gram">
<xs:scale fixed="true" value="1:1000" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="miligram">
<xs:restriction base="xs:gram">
<xs:scale fixed="true" value="1000:1" />
</xs:restriction>
</xs:simpleType>
Is there any standardized way to do this yet?
Tom Van de Putte.
If have been searching for a while, without finding, for a way to
restrict a datatype from a certain basetype by relation instead of
strict restriction.
For example: (in the metric system) to relate a datatype named kilogram
to gram or liter to mililiter.
This would make it possible to move between related datatypes.
Say where given a two values: 1.5 kilogram and 500 gram and we need to
count them as one value.
If we would 'know' that 1000 gram is equal to 1 kilogram we could do
the math.
This could be done by optional facets like:
<xs:simpleType name="gram">
<xs:restriction base="xs:decimal"></xs:restriction>
</xs:simpleType>
<xs:simpleType name="kilogram">
<xs:restriction base="xs:gram">
<xs:scale fixed="true" value="1:1000" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="miligram">
<xs:restriction base="xs:gram">
<xs:scale fixed="true" value="1000:1" />
</xs:restriction>
</xs:simpleType>
Is there any standardized way to do this yet?
Tom Van de Putte.