Target applications:
- high load systems
- there where the size matters
Objectives:
- to free developers from XML-hell
- to simplify indexing of documents
- etc...
Conventions:
- bits: 7(most) 6 5 4 3 2 1 0(least)
- the octet is 8-bit sequence
- octets-ordering: MSB(The most octet first), "big endian";
- TLV - Tag Length Value encoding.
Description:
SXML-document is TLV-encoded octets sequence.1. Tag:
1.1 The first octet: bit 7(most) — flag "not last", if 1 — next octet is tag's part too.
Bit 6 — flag "complex", if 1 — field is complex, if 0 — field is raw data.
Bits 5-0 — the tag itself from 0 to 63(0x3F).
1.2 The next octets in sequence: bit 7 — flag "not last", bits 6-0 — tag itself from 0 to 127(0x7F).
2. Size: octets sequence.
Bit 7 — flag "not last", bits 6-0: the number of inner tags or number of octets in "value" part.
3. Value: inner tags or raw data.
Example:
sequence:
7002001E687474703A2F2F73786D6C2E6D79736573742E72752F737065632F312E305005030120010548656C6C6F0301200205576F726C64040121
after split:
tag size data
70 02 complex, 2 inner tags
00 1E 687474703A2F2F73786D6C2E6D79736573742E72752F737065632F312E30
"http://sxml.mytest.ru/spec/1.0"
50 05 complex, 5 inner tags
03 01 20 " "
01 05 48656C6C6F "Hello"
03 01 20 " "
02 05 576F726C64 "World"
04 01 21 "!"
after decoding:
http://sxml.mytest.ru/spec/1.0 Hello World!


