OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: Units of measurement?

[ Lists Home | Date Index | Thread Index ]
  • From: "Arnold, Curt" <Curt.Arnold@hyprotech.com>
  • To: 'Ronald Bourret' <rbourret@ito.tu-darmstadt.de>, 'XML Dev' <xml-dev@ic.ac.uk>
  • Date: Thu, 15 Jul 1999 10:00:25 -0600

This has been a real problematic area in earlier attempts to transfer
engineering information between applications.  In a lot of the STEP
proposals (I'm not a STEP expert so please forgive any inaccuracies), there
was a desire/requirement/need to preserve exactly the user's specification
of the value that was done at the expense of engineering apps that primarily
just wanted the value in SI.  

Unfortunately, that meant that one had to include in the STEP file all the
unit strings and their conversion factors to some base unit (and hope the
file had some unit you could recognize as your base unit).  I gets really
complicated really quickly.  Like in your example, most people would
interpret mph as miles per hour, but somebody else could use it for meters
per hour (or metres per hour).  In complex dimensions, you could have
thousands of reasonable permutations (whether to use dots between units,
slashes or -1 for units in the denominator)

Since in the types of apps I deal with only a very small fraction of "data"
is user provided (and hence would have some value to preserve what the user
type) and most of it is calculated (typically in SI or close to SI units),
my approach is to have an attribute for the value in a fixed SI unit (and in
a schema world it would be associated with a datatype that specified the
unit) and if you want to preserve the users input then use the elements text
data.  So for speed it would be something like 

He was travelling at <Velocity value="1">3600 kph</Velocity>

where value is defined as always being in meters per second.  In schemas,
I'd have a velocity datatype that was defined as being in meters per second.

If you though it could add value, you could tag the unit.

<Velocity value="1">3600 <UnitRef href="#kph">kph</UnitRef></Velocity>

This also allows you to support really fuzzy user specified values that you
could never hope to resolve by parsing the human presentation.

You know how <Temperature value="289">cold it feels on a brisk fall
morning</Temperature>   

(289K, 16C, 59F for those of you who don't think that Kelvin is the
temperature unit of choice)


-----Original Message-----
From: Ronald Bourret [mailto:rbourret@ito.tu-darmstadt.de]
Sent: Thursday, July 15, 1999 2:55 AM
To: 'XML Dev'
Subject: RE: Units of measurement?


Jeffrey E. Sussna wrote:

> Does the XSchema datatypes spec support the notion of units of 
measurement?
> In other words:
>
> 	element "x" is of type "speed", which can be in "mph" or "kph"
>
> A potential representation of this might be:
>
> 	<x units="mph">200</x>

Sort of.  What you can actually do is define a speed data type and say that 
the *units* attribute (not the x element) is of type speed -- that is, its 
value is either "mph" or "kph".  You can also say that the x element must 
have a units attribute.

Note that you can also do this specific example with DTDs, by defining 
units as an attribute with an enumerated type.

(Nit: XSchema is the name of the predecessor of DDML. I believe you are 
referring to XML Schemas -- the schema language being developed by the W3C. 
 Given the amount of confusion over these names, I'm beginning to wonder if 
we shouldn't donate the XSchema name to the W3C...)

-- Ron Bourret


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN
981-02-3594-1
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following
message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS