Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Restricting xml schema datatypes by relation?.

From: goldfrapper@-----.---
To: NULL
Date: 11/1/2006 6:27:00 AM


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.



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent