Names, Dates, Etc.

Michael.Kay at icl.com Michael.Kay at icl.com
Fri Jan 15 12:13:50 GMT 1999


> >For all of these, we need architectures rather than markup languages
> >per se, because applications may need more than one name, date,
> >or money amount.

I've actually hit this in a recent project which is using all three of these
data types. I have to say I got myself a bit confused; in traditional data
modelling we distinguish between the property name (e.g. recipient) and the
domain (e.g. personalName), and I wasn't at all sure which of these to use
as the XML element name, especially when the element had sub-structure. I
guess architectural forms would have helped here, but they aren't mainstream
XML. I toyed with double nesting (e.g.
<recipient><personalName>Fred</personalName></recipient> but this seems
horribly clumsy. I also thought of using a fixed attribute
(dataType="personalName") in the DTD, but I don't particularly like fixed
attributes e.g. because they vanish when you use a non-validating parser.

In the end I just used the property name (<recipient>) and left the data
type as implicit, something the receiving application is expected to know.

Anyone have any better ideas?

Mike Kay

PS: I decided not to tag the substructure of dates and currency in XML, so
currency appears just as GBP123.45, and dates as 1999-01-13. I tried XML
substructures at one stage but the troops rebelled.

Incidentally, I don't think "," as a decimal separator is any more
international than ".", unless you use "international" in the U.S. sense of
"not American". What you should really be using is a "middle dot"...


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list