Re: EXI primer vs EXI specification

Good afternoon Daniel,

Thank you, it does help.

v/r,
Brandon

From: "Peintner, Daniel" <daniel.peintner.ext@siemens.com>
Date: Friday, September 1, 2023 at 8:48 AM
To: Brandon A Born <baborn@sei.cmu.edu>, "public-exi-comments@w3.org" <public-exi-comments@w3.org>
Subject: RE: EXI primer vs EXI specification

Hi Brandon,

The primer is too restrictive with using "must".
EXI can encode any order of attributes. Anyhow, if you want best compression/performance it is *best* to sort them.

The reason is that EXI grammars describe what is likely to occur and the more likely the more compact the stream may get. Attributes in EXI grammars are sorted.
Hence if you have 3 required attributes a1, a2 and a3 it is best to sort them accordingly since the EXI grammars expect them in this order. If you provide them in a different order they can still be represented but less efficient.

Therefore, most implementations will sort them.

Note: in EXI strict mode (**encode only data as expected**) they "must" be sorted.

I hope this helps,

-- Daniel



From: Brandon A Born <baborn@sei.cmu.edu>
Sent: Wednesday, August 30, 2023 10:24 PM
To: public-exi-comments@w3.org
Subject: EXI primer vs EXI specification

Good Afternoon,

I am just doing some R&D on sending XML messages between systems using EXI. After working with a number of EXI processors and some internal code, I have a question about the EXI specification that seems different between the specification and primer.

Specifically: the order of AT events in schema informed. The main document gave me the impression that they should be sorted lexicographical but the primer to me sounds like they must be lexicographical.

The Specification:
https://www.w3.org/TR/exi/#informedGrammars


“Otherwise, when the grammar in effect is a schema-informed element grammar or a schema-informed type grammar (see 8.5.4 Schema-informed Element and Type Grammars), the remaining attributes can occur in any order that is permitted by the grammar, though in practice they SHOULD occur in lexicographical order sorted first by qname local-name then by qname uri for achieving better compactness, where a qname is a qname of an attribute.”

The Primer:
https://www.w3.org/TR/exi-primer/#schemaInformedGrammar


Note that AT(category) is accepted before AT(date) even though their order is reversed in the schema. This is because attributes in schema-informed grammars must be sorted lexicographically, first by local name and then by namespace URI. Attribute sorting reduces the number of options which, in turn, greatly simplifies grammar creation and improves compactness. Since this automaton does not include transitions on AT(*) or SE(*), any deviations from the schema will result in an encoding error.

Just wondering if this is my misunderstanding or just a difference in the documentation.

Thank you,
Brandon

Brandon Born

Carnegie Mellon Software Engineering Institute
Software Solutions Division (SSD)
Tactical and AI-Enabled Systems Initiative (TAS)

4500 Fifth Ave.
Pittsburgh, PA 15213
Phone: (412) 268-4824

Received on Friday, 1 September 2023 18:55:41 UTC