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

Re: basic qs - how is xml more flexible for exchanging data?

  • To: "'xml dev'" <xml-dev@l...>
  • Subject: Re: basic qs - how is xml more flexible for exchanging data?
  • From: "cr88192" <cr88192@h...>
  • Date: Fri, 16 Sep 2005 11:07:43 +1000
  • References: <MC11-F13JMYTcecyvfB00240fc9@m...>

rearange xml

----- Original Message ----- 
From: "Michael Kay" <mike@s...>
To: "'Anil Philip'" <goodnewsforyou@y...>; "'xml dev'" 
<xml-dev@l...>
Sent: Friday, September 16, 2005 7:56 AM
Subject: RE:  basic qs - how is xml more flexible for exchanging 
data?


> My copy of the C language specification says that the language doesn't
> define how many bits there are in a character or integer, what character
> code is used, what order the fields in a struct are stored in, whether
> integers are twos complement, or in fact anything else about the physical
> representation of data. So how can this possibly define an interchange
> format that anyone can rely on?
>

this is true, though there are often "sanity limits" to all this.


one can often further specify, eg, that "int" is a 32 bit 2's complement 
integer in little-endian ordering, or one can come up with more descriptive 
type names('s32le', for example). in this way, struct-like representations 
are common in many file-format specifications (vs the ascii art and bnf-like 
notations found in some specs).

even absent this and other clarifications, one can often "rule of thumb" 
their way through it, eg:
for a fairly long time, 'char' has been informally defined as an octet (of 
undetermined sign);
on most recent computers, an int is 32 bits, and long is 32 bits "most of 
the time" (at least for the time being);
2's complement and ascii is near-ubiquitus;
most compilers don't rearange struct contents;
..

so, in general, with the code and some idea what the code ran on, one has a 
pretty good idea what is in the files. it is not like it is a world of 
"total" chaos...


agreed though, a higher-level representation is often preferable, or at 
least treating the file as a long stream of bytes to be read/written 
individually...

there do exist many specifications for many portable binary formats after 
all.

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.