[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: What are units-of-measure? e.g., what's a "kilometer"?


kilometer type of unit
Roger L. Costello wrote:

> This is quite a radical approach.  I am surprised that there
> aren't more comments, since the "conventional wisdom" is
> not to treat kilometer as a property/relation/function, but rather
> to treat it as the value of a property, e.g.,
> 
>   <River id="Yangtze">
>        <length unit="kilometer">6300</length>
>   </River>

The advantage of "<kilometres>6300</kilometres>" as opposed to <length 
unit="kilometre"> is in modularity of type definition.

With the unit= approach, you're probably saying that the type of length 
is an attribute that can be km/miles/nautical miles/etc, and a value 
which is a number.

However, if you want to allow other types of length measurement - non 
numerical ones such as giving the name of another object of the same 
length, say - then with the latter approach your 'type' might need to 
widen to include any value as the distance, not expressing the fact that 
for kilometres it'd better be a number, while if you have a 
"<kilometres>" element then you can state that it contains an integer 
while a "<same-as>" element contains a string.

However, smarter type systems let you define types in terms of things 
like "distances where unit='kilometres'" and thus allow you to organise 
it however you want, so it becomes a moot point.

I find "unit=''" more pleasing on the eye, myself.

> Thoughts?  /Roger

ABS


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.