

Re: Cutting the Patrician datatype knot

From: Thomas B. Passin <tpassin@home.com>
Date: Tue, 4 Dec 2001 01:38:32 -0500
Message-ID: <003f01c17c8e$4b3b43e0$7cac1218@cj64132b>
[Pat Hayes]


Strangely enough, someone I work with has come up with a perceived need for
exactly this kind of datatype, for use with XML Schema.  The work involves
translating another format into XML, and the datavalues are integers but
they also have mnemonic values.  It is desired to use the mnemonic
(readable) values for XML, but someone wants to be able to use the original
code values if someone wants to do that.  These values come from someone
else's data dictionary and probably can't be changed

Ideally one would like to enforce pairing of the code value and the
mnemonic, so that if you have both they agree (e.g., 1=='west'), but you
can't enforce that with XML Schema.  The fallback position is to allow
either a numeric code value, a string mnemonic, or both, but without
enforcing their correlation (I suggested Schematron but that hasn't been
accepted so far).  The most convenient way seemed to be a union type.  The
correlation is documented an an xsd:annotation element.

I don't know if this approach will survive, but for the time being, there is
this union datatype...


Tom P
Received on Tuesday, 4 December 2001 01:38:34 GMT
