[Date Prev][Date
Next][Thread Prev][Thread Next][Date
Index][Thread Index]
RE: Re: [Project] XML, Byte Encoded XML, How does it talk ?
- To: <ukha_d@xxxxxxx>
- Subject: RE: Re: [Project] XML, Byte Encoded XML, How does it
talk ?
- From: "Primoz Gabrijelcic" <gabr@xxxxxxx>
- Date: Thu, 24 May 2001 13:35:36 +0200
- Delivered-to: rich@xxxxxxx
- Delivered-to: mailing list ukha_d@xxxxxxx
- Mailing-list: list ukha_d@xxxxxxx; contact
ukha_d-owner@xxxxxxx
- Reply-to: ukha_d@xxxxxxx
> > <operation>
> > <light
> > mode=on>
> > </light>
> > </operation>
> >
> > with a dictionary
> >
> > operation (start tag)=01,
> > operation (end tag)=02
> > light (start tag)=03,
> > light (end tag) =04
> > mode=05 becomes
> >
> > 01,03,05,"o","n",04,02
> >
> Ahh, now I understand. But that would give you only 256 tags ?
Actually less, because characters and numbers (at least) must not be tags.
If you use only non-printable part of ASCII (lower 32 codes) and all codes
above 128 that gives 160 tags. Or 80 different tokens as each token
requires
start and end tag.
I would modify the original spec as follows:
- Tags lie in the ranges 0..31 and 128..256.
- Start tags lie in the ranges [0..15] and [128..191].
- <end tag> is <start tag> + 16 if <start tag> in [0..15]
<end tag> is <start tag> + 64 if <start tag> in
[128..191]
That allows you to use full printable 7-bit ASCII set and still have 80
different tokens defined. Even more, this specification allows receiver to
skip unknown commands because it can deduce end tag from the (unknown)
start
tag.
If 80 tokens are not enough, you can still defined character 127 (which is
non-printable but not used in the definition above) to mean 'next byte is a
tag'. Of course, those 'extended tags' would be divided into start tags
(0..127) and end tags (128..255). Or you can exclude 127 and 255 (use range
0..126 for start tags and 128..254 for end tags) and use 127 for further
extensions. That way, code can become infinitely extendible - when you run
out of tags, you just have to add another 127 and, voila!, 254 new tags are
available!
Primoz
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Home |
Main Index |
Thread Index
|