[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Why XML data typing is hard

  • From: <david@m...>
  • To: "XML Developers' List" <xml-dev@i...>
  • Date: Mon, 30 Nov 1998 09:43:35 -0500 (EST)

hard typing
Michael Kay writes:

 > "4,50" is a localized rendition of a float value. But in XML we
 > should encourage a rendition-independent encoding of information.

That is one of the biggest problems with applying concepts from data
storage to syntax.  XML *is* pure external representation -- in a
database, I can take any of the following appropriate to my locale and
store it internally as the same bunch of bits:

  4,5
  4,50
  4.5
  4.50
  004.500

When I want to render that bunch of bits, I can pick any appropriate
rendition based on the user's locale and formatting requests (for
example, the user might have typed "4.50" into a field in a form, but
the report for a French user might show "04,5").

With XML, though, it is the representation itself that I'm exchanging,
not the abstract data (though perhaps in the future people might want
to pass around compiled DOM trees -- who knows?).  That means that if
I put

  <balance>4.50</balance>

and send the document to a French user, the French user will still see 
the strange, foreign

  <balance>4.50</balance>

There's not a general-purpose, locale-independent way of storing it.
You could define a local-independent text representation of a
floating-point number, but then you're just adding yet another
representation to the list.

Please note that I'm *not* opposed to data typing: I think that it's
necessary and that we will see something like it sooner or later.  I
know that the XML Schema WG plans to work hard on data typing and that
since there are many good, talented people in that WG, they are very
likely to surprise us; in the mean time, however, I just want to
emphasise that [1] the problem is not easy when you move beyond a
specific locale and/or application domain (regular expressions won't
cut it for usability), and that [2] the solution will likely provide
less functionality than many people expect.


All the best,


David

-- 
David Megginson                 david@m...
           http://www.megginson.com/

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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.