RE: [EXI] Clarification required regarding use of types

Hi Santhanakrishnan,

In schema-informed grammars, there are two kinds of CH events
for use with simple types, which are CH [schema-valid value] and
CH [schema-invalid value].

Character data that matched CH [schema-valid value] is represented
in EXI stream as a typed value using one of the EXI built-in datatypes.
See "Table 7-1 Built-in EXI Datatypes" for the relationship between
schema datatypes and EXI built-in datatypes, which you can find at:
http://www.w3.org/TR/exi/#builtInEXITypes

In the case of the production "TypeUri_0: CH [schema-valid-value] TypeUri_1",
because the production was generated from simple type "TypeUri",
when character data matches that production, the character data is
represented according to schema type "TypeUri". Because TypeUri
is derived from xsd:string, it is represented using EXI built-in datatype
"String".

xsi:type causes to switch the grammar to the one generated from
the type that it refers to, if the type is given definition in the schema.
See XML Schema specification for the semantics of xsi:type at:
http://www.w3.org/TR/xmlschema-1/#xsi_type
EXI processes xsi:type in order to permit any schema-valid document
to be represented as an EXI stream. Without being aware of xsi:type,
schema-valid documents that use xsi:type would not be able to be
represented by EXI. When strict option is true, a production of xsi:type
is added only when the schema permits the its use, that is, when
the type of the element has named subtypes. When strict option is
false, that production is always added to the element grammar.

Hope it helps,

-taki


________________________________

From: public-exi-request@w3.org [mailto:public-exi-request@w3.org] On Behalf Of santhanakrishnan
Sent: Wednesday, May 14, 2008 7:30 AM
To: john.schneider@agiledelta.com; public-exi@w3.org
Subject: RE: [EXI] Clarification required regarding use of types



Hi John

Thank you very much for your clarification
Some parts are still not clear to me.

Consider the following case.

Suppose I have the following schema definition.
(shown below is a segment of schema)

    .....

    <xs:simpleType name="TypeUri" final="list restriction">
           <xs:restriction base="xs:anyURI"/>
    </xs:simpleType>

    <xs:element name="MyUri" type="TypeUri" minOccurs="0"/>

    <xs:element name="MyString" type="xs:string" minOccurs="0"/>

    .....



For this I would have a grammar like this.

For Simple Type Definition TypeUri

TypeUri_0:
           CH [schema-valid-value] TypeUri_1

TypeUri_1:
           EE

TypeUri_Empty_0:
           EE



For element MyUri

MyUri_0:
           TypeUri_0



For element MyString

MyString_0:
           xs:string_0

As there is no grammar available for xs:string we will define one like this

xs:string_0:
           CH [schema-valid-value] xs:string_1

xs:string_0:
           EE

xs:string_Empty_0:
           EE



After all this grammar definitions still there is some ambiguity in the definition
of TypeUri. It is lacking the schema basic type information unlike the xs:string
type. Only when I know the schema basic type I can perform the low level
encoding/decoding of the value as per that.

Also the specification talks about adding production AT(xsi:type) to the
element grammar when it is of some named sub type. What is the significance
of this AT(xsi:type) event ?  How and when it has to be generated ?

Please clarify me in this regard and help me in resolving the confusion.


Thanks in advance,

Santhanakrishnan

Received on Thursday, 15 May 2008 00:26:31 UTC