W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2001

Re: Conventions for monetary values

From: Martin Gudgin <marting@develop.com>
Date: Wed, 4 Jul 2001 08:28:17 +0100
Message-ID: <001a01c1045a$e6fafa20$0300a8c0@greyarea>
To: "Michael Brennan" <Michael_Brennan@Allegis.com>, <xmlschema-dev@w3.org>
There is currently some discussion of this among the type library task
force. The three forms you identify below have been discussed. The first two
examples you show below will probably end up in the type library in some
form at some point.

Martin Gudgin
DevelopMentor

----- Original Message -----
From: "Michael Brennan" <Michael_Brennan@Allegis.com>
To: <xmlschema-dev@w3.org>
Sent: Wednesday, July 04, 2001 1:56 AM
Subject: Conventions for monetary values


> I'm curious if there are any prevailing conventions for representing a
> monetary value in XML.
>
> Currently, we use a complex type that includes a "unit" attribute whose
> value is a 3 character ISO currency code, e.g.:
>
>   <price unit="USD">10.00</price>
>
> I've thought of changing this to use element content:
>   <price>
>     <unit>USD</unit>
>     <value>10.00</value>
>   </price>
>
> I've seen some conventions that do this with a simple type, e.g.:
>
>  <price>10.00 USD</price>
>
> or worse:
>
>  <price>10.00USD</price>   (note, no white space, so you can't define it
as
> a list type)
>
> I'm not fond of these. I prefer leveraging the XML syntax to more
explicitly
> differentiate the number portion from the unit.
>
> So what are other people doing? Are there any prevailing conventions out
> there?
>
Received on Wednesday, 4 July 2001 03:30:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:22 GMT