Sam::XML and Web Services : XML and Web Services
Updated: 10/2/2002; 3:08:25 PM.

 

Categories:
Personal Friends:

Subscribe to "Sam::XML and Web Services" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Sunday, September 08, 2002

Binary XML.

Clemens Vasters, Ingo Rammer, and Brad Wilson are all debating binary XML.

I think they all agree that for long-term storage you need to leave it as text. For transient messages, Binary XML is a valid option in my mind. Especially when you want to send XML to a wireless device.

One thing that Brad mentioned was solving the endianess problem. I'm not sure why he put this as a con. This has already been solved in the XML 1.0 world. Take a look at UTF-16LE, UTF-16BE, UTF-32LE, etc. They have a nice 2 or 4 byte order mark (BOM) as the first 2 or 4 bytes of the data. This tells the processor the format and the endianess. In fact most XML parsers are smart enough to not need that BOM. Because the 1st character represented in XML has to be '<'; So I see this as a non-issue.

I have a couple of issues though after thinking about Binary XML in general -

  1. Is data still going to be represented as strings? I.e. I have the following fragment 10. To the human eye that is a number. So in my binary serialization do I serialize that as 1 byte for the value or 2 bytes (assuming UTF-8) for the characters '1' and '0'? Or even 4 bytes because it is a 32-bit integer?
  2. This relates to the first one - if I do serialize the data as its native representation (i.e. a 4 byte integer), aren't I requiring an XML Schema for that XML now? Do I have to have some type of embedded pseudo schema that says 'units is a 4 byte integer'?

Let's say we do continue to save everything in the binary as characters (i.e. 2 bytes for '1' and '0'). What is binary saving us? The <, >, and whitespace?

I haven't thought it all the way through yet. And these are some questions that I've raised in my own head. Maybe someone else already knows the answers.

[News from the Forest]
5:51:57 PM    


© Copyright 2002 Sam Gentile.



Click here to visit the Radio UserLand website.

 


September 2002
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          
Aug   Oct