Lists Home |
Date Index |
Derek Denny-Brown wrote:
> Reinventing XML would mean going back to SGML and restarting the long
> and arduous process of trimming that down. Binary-xml is not about
> reinventing XML, it is about leveraging large parts of the existing XML
> ecosystem of tools, languages, and general knowledge. Having worked
> with binary-xml, in a number of forms, including implementing full
> well-formedness validation, binary-xml can easily be much faster than
> XML. For some scenarios (especially where binary serialization would
> avoid numeric type conversions) the performance gain can be huge.
Ooh, I forgot that one. It's a classic case of supersetting, and of how
some binary proposals fail to be real XML in a way that doesn't simply
involve serialization, and does involve reinventing and redefining XML.
XML documents do not contain numbers in a typical programming language
sense. They contain strings, which may be made up of digits, and which
may be interpreted as Java/C#/Fortran/etc. ints, reals, floats, doubles,
However, no XML document ever actually contains numbers in the sense
that would allow one to avoid numeric type conversions.
It's plausible that one could define a numeric format for integer types.
You'd have a little trouble dealing with arbitrarily sized integers (the
number 217836127368127638712638721638712368127638712638172368127 is much
easier to write in an XML document than to process in C, Java or
Fortran) but that's surmountable. Once you hit floating point types,
though, the problems become Everest sized. Even if a simple example such
as 1.2 loses information if encoded as an IEEE-754 float or double, as
are used by most modern platforms.
I suppose you could always take the XOP cop-out, and claim that what you
meant to write was not actually 1.2, but rather the Base-64 encoded
value of the eight bytes that make up 1.2 in the IEEE-754 round-to
nearest mode, or some such; but then you're forcing base-64 encoded data
into a text representation of XML that doesn't need it; plus you're
breaking schema-validity; and in any case this is a rationalization, not
something anybody really believes in.
That in the midst of this argument you would raise the issue of natively
encoding numbers as an example of the good things a binary XML format
can do just show how far apart we are. Real XML doesn't have numeric
types and never has. At most they're one possible annotation from a
schema, or one interpretation which a program might apply to a
particular string of text, but they are not something that exists in any
Elliotte Rusty Harold firstname.lastname@example.org
XML in a Nutshell 3rd Edition Just Published!