Re: [EXI] Significance of Fidelity Option preserve.lexicalvalues

santhanakrishnan <santhana@huawei.com> writes:

>        What is the significance of the fidelity option
> preserve.lexicalValues? What is the effect of this option on Element Names
> when set or unset?

The lexicalValues preservation option only affects text content and
attribute values, not element or attribute names at all.

When there is external type information, such as from a schema, the
usual case in EXI is to encode typed data according to its datatype.
The lexicalValues preservation option disables this and causes all
such data to be encoded as strings.  For instance, if the Infoset to
be encoded contains a value "00123" that the schema defines to be an
xsd:integer, normal EXI encoding will encode it as the integer 123
(taking up one octet in the EXI document), but with this preservation
option on, it will be encoded as the string "00123" (taking up six
octets, one for length and one for each of the characters, in the EXI
document).

This option is expected to be used when not just the typed value but
its precise lexical representation is important.  As you can see from
the example above, normal EXI encoding cannot distinguish between
"123" and "00123" as representations of the integer 123.  For example,
when signing XML documents, it is important that the receiver can
produce the exact same content that was signed by the sender, so if a
signed document is sent as EXI, it is important to turn on certain
preservation options, including lexicalValues, to ensure everything
works.

See also sections 3.2 and 3.3 of the EXI Best Practices document
(http://www.w3.org/TR/exi-best-practices/).

-- 
Jaakko Kangasharju, Helsinki University of Technology
Lame homepage at http://www.iki.fi/ashar/

Received on Tuesday, 25 March 2008 10:02:03 UTC