Why XML data typing is hard

Joel Bender joel at spooky.emcs.cornell.edu
Tue Dec 1 20:18:46 GMT 1998


G. Ken Holman wrote:

>  In Canada, valid expressions of currency numbers are $1.47 or
>  1,47$ based on where you are.

I was under the impression that there was some standard patterns/parsers
for this stuff being designed.  So:

	<value xml:type="currency">1.5</value>

Gets parsed as if it was specified as:

	<value xml:type="currency" xml:country="Canada.English">1.5</value>

(No offense intended to those in French Canada that want to make it their
own country.)

>  I gather from Michael S-McQ in a presentation in Chicago that
>  the regular expression for a valid date (taking into account
>  days of the month and leap years) is 4801 characters long.

Probably an interesting effort, what we used to call a "weekend and a case
of beer" project.  I'm sure that another notation could be found that would
reduce this significantly, roll a little grep and JavaScript together or
something :-).

This discussion is important to me because my application to test protocol
conformance needs to suck in an XML description of an "implementation under
test" and translate the '1.5' into an IEEE float that will appear on a
wire.  My app will need at least some guidence on accepting '1,5' and/or
'1.5' and/or the Japanese Unicode string that means the same thing.  The
good news for me is that I really only need to deal with SQL data types.


Joel

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