Robert
> 
> Thank you for publishing this list.  I was wondering about adding three
> additional types:  
> The first type is currency, which would require a combination of a decimal
> and a monetary unit.  Conceivably, one would want to specify a time as well,
> since exchange rates are dynamic (in the sense of 'time dependent').  This
> could be useful in catalogs which displays prices in local currency.

I will add an example of a compound datatype for this, along the following lines

<xsd:element name=”Amount”>
 <xsd:simpleType name=”Amount” base=”xsd:decimal”>
  <xsd:precision value=”8”>
  <xsd:scale value=”2”>
 </xsd:simpleType>
 <xsd:attribute name=”currency” type=”xsd:string> 
  <xsd:enumeration value=”USD”/>
  <xsd:enumeration value=”GBP”/>
  <xsd:enumeration value=”FRF”/>
  …
 </xsd:attribute>
</xsd:element>

> 
> The second type would be something like 'unit of measure', which would a
> quantity like 'kilogram', 'Joule', Newton-meter', 'foot-pound', 'square
> inch' and so forth.  The goal would be to have a computer recognize that
> inches and meters are both units of length, but that feet and Newtons are
> not dimensionally the same.  Fundamentally, it would be useful to recognize
> that physical measures can be traced back to a few dimensional types
> (length, time, mass, electrical charge and temperature make up a useful set)
> and products of these basic types.(area = length^2, energy = mass *
> length^2/ time^2, etc.)  This would allow one to automatically convert units
> to the user's preferred system (Imperial for American non-scientists) and SI
> for everyone else :^)  

Sorry, but American non-scientists can't easily be coped with by using patterns. For 
SI units things are relatively easy, as the following example shows:

<xsd:element name=”Measurement”>
 <xsd:simpleType name=”Amount” base=”xsd:decimal”>
  <xsd:minExclusive value=”0”/>
 </xsd:simpleType>
 <xsd:attribute name=”units” type=”xsd:string> 
  <xsd:pattern value=”[mckMT]{0,1}[gmsKC](^[0-3]){0.1}
                      (/[msKC]{0.1}(^[0-3]){0.1})”/>
 </xsd:attribute>
</xsd:element>

(what is the SI symbol for electrical charge? (I'm on a train at present and don't 
have my copy of the SI standard to hand!)
> 
> This leads directly to the third type which would be something like
> 'measurement', which would be a quantity (a decimal or floating point
> number) and a unit of measure.  An important facet of a measurement is the
> uncertainly, which could be expressed as a range, or in more advanced
> applications (in science, engineering and quality management for example) by
> a probability distribution.  A standard language for this facet would be
> useful, but probably quite complex.

Probability distribution would require a data structure rather than a datatype. For 
ranges you could use something along the lines of

<xsd:element name=”Measurement”>
 <xsd:simpleType name=”Amount” base=”xsd:string”>
  <xsd:pattern value=”[0-9]{1,}(.[0-9]{1,}){0,1}
                      (&plusmin;[0-9]{1,}(.[0-9]{1,}){0,1}){0,1}”>
 </xsd:simpleType>
 <xsd:attribute name=”units” type=”xsd:string> 
  <xsd:pattern value=”[mckMT]{0,1}[gmsKC](^[0-3]){0.1}
                      (/[msKC]{0.1}(^[0-3]){0.1})”/>
 </xsd:attribute>
</xsd:element>

> > With these additions, one would have a powerful set of tools to describe
> physical objects and their attributes.  This is a bit different direction
> that your original list, so I don't know if it is relevant to your goals.

I feel that this is probably outside the range of basic B2B, but will add the examples 
above as an example of how you can build derived datatypes from the basic ones listed.

Martin  Bryan


==========================================
XML/EDI Group members-only discussion list
Homepage =  http://www.xmledi.org

Brought to you by: Online Technologies Corporation
                  Home of BizServe - www.bizserve.com

TO UNSUBSCRIBE: Send email to <[EMAIL PROTECTED]>
               Leave the subject blank, and
               In the body of the message, enter ONLY: unsubscribe

Questions/requests should be sent to: [EMAIL PROTECTED]
To join the XML/EDI Group complete the form located at:
http://www.geocities.com/WallStreet/Floor/5815/mail1.htm


Reply via email to