OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] bohemians, gentry

[ Lists Home | Date Index | Thread Index ]

At 02:43 PM 12/4/2002 -0500, Rich Salz wrote:
>I hope the following is concrete enough.

Yes - thanks for this! This is exactly the kind of concrete example I am 
looking for.

>Imagine the following element:
>(See http://www.joyofpi.com/pi.htm for details).
>Suppose you are building a web services front-end to Macsyma (or 
>Mathematica).  You might be tempted to add this attribute (assuming the 
>"obvious" xmlns declarations)
>         xsi:type=xsd:float
>The problem is, that if you use something like DevStudio.Net and its 
>wizards, you've guaranteed to have lost precision.  That's a shame, 
>because the math tool has effectively infinite precision, but my 
>XML/WS/XSD tool artificially limits itself to IEEE floats because it 
>thinks it's doing me a favor by making it trivial to generalize object 
>serialization through XML.

Well, there's a problem you will encounter earlier. Float and double are 
restricted to 32 and 64 bits respectively:

>3.2.4 float
>    [Definition:] float corresponds to the IEEE single-precision 32-bit
>    floating point type [IEEE 754-1985].
>3.2.5 double
>    [Definition:] The double datatype corresponds to IEEE
>    double-precision 64-bit floating point type [IEEE 754-1985].

That means that your document would not validate if you used these 
datatypes. Of course, if you *did* use these datatypes, then a wizard could 
make safe assumptions about precision, but your example precludes use of 
these types.

There *is* a datatype that I could use to represent Pi to ten thousand 
digits (or one million if I bought the book):

>3.2.3 decimal
>    [Definition:] decimal represents arbitrary precision decimal
>    numbers.

If the document uses this datatype, then the Wizards had better be aware of 
what the phrase "arbitrary precision" means. Using the datatype is a clear 
warning to applications. Without the datatype, an application might 
encounter decimals of very different sizes, but not be aware that arbitrary 
precision numbers might arise until they encounter the first REALLLY BIG 

Of course, you can write schemas that use decimals of fixed precision too. 
In either case, the schema is explicit about the kinds of data applications 
should be prepared to handle.

So isn't the use of datatypes more helpful than harmful in this case?



News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS