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

Conventions for monetary values

From: Michael Brennan <Michael_Brennan@Allegis.com>
Date: Tue, 3 Jul 2001 17:56:15 -0700
Message-ID: <753B28EF1C2DD411AF1C00B0D0202CB5014D4137@mailhost.hq.allegis.com>
To: xmlschema-dev@w3.org
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:

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
Received on Tuesday, 3 July 2001 20:55:43 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:52 UTC