Units of measurement?

Arnold, Curt Curt.Arnold at hyprotech.com
Fri Jul 16 18:51:03 BST 1999

I had a mental lapse and did the conversion wrong, which I already confessed
to the xml-dev mailing list.

What I should have typed was:

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

The interpretation here is that the schema author defined the value
attribute of the velocity tag as having a velocity datatype derived from
real that was always interpreted as being the velocity meters per second.
The specific unit is the schema designers choice, though, of course. There
is nothing that the document author can do to change the interpretation of
the attribute. The document author could put just about anything in the
element content, but a search engine that was trying to find any documents
that mention greater than a specific value wouldn't have to try to convert
velocities to a common basis.  Information transfer can occur because the
schema author unabiguously defined the interpretation of the attribute.  For
example, it would be real easy to color code the following fragment based on
the velocities.

He was travelling at <Velocity value="1">3.6 kph</Velocity>, somewhere
between a <Velocity value="0.8">leisurely stroll</Velocity> and a <Velocity
value="1.5">brisk walk</Velocity>.

Again, this is a pattern that I have found useful that has the ability to
preserve the specific textual representation a user entered while allowing
applications that don't need to process that information to be able to deal
with the ambiguities of unit conversion.  Other than it would be nice to be
able to extract the unit from the attribute definition in the schema, it
does not require or suggest any changes to any established XML technologies.
The initial message that started this hinted that xml should be much more
aware of units.

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/ and on CD-ROM/ISBN 981-02-3594-1
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