W3C home > Mailing lists > Public > public-exi@w3.org > May 2008

RE: [EXI] Clarification required regarding use of types

From: santhanakrishnan <santhana@huawei.com>
Date: Thu, 15 May 2008 19:44:31 +0530
To: 'Taki Kamiya' <tkamiya@us.fujitsu.com>, public-exi@w3.org
Message-id: <005c01c8b695$ff349e80$4a18120a@china.huawei.com>
Hi Taki

    Thank u very much for your explanation. Please confirm my understanding.

For the below schema definition

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

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


The element MyString would be defined as 




Grammar for xs:string 


       CH [schema-valid-value] xs:string_1




MyString will become like this finally


       CH [schema-valid-value] xs:string_1

Assuming strict mode as type of MyString does not have a named sub type I
would not add the AT(xsi:type) production to its definition.

But for element MyUri, I would have to define as



Applying from TypeUri grammar


       CH [schema-valid-value] Type_Uri_1

As type of MyUri has named sub type I would add the AT(xsi:type) production
to its definition.

Finally MyUri would be defined as


       CH [schema-valid-value] Type_Uri_1

       AT(xsi:type) MyUri_0

Am I correct till here? 

The CH production in MyUri_0 does not add much value here as the proper
grammar would be loaded when AT(xsi:type) event occurs.

Please confirm my understanding here. If I still have some misunderstanding,
any explanation with good example will help me a lot. 





-----Original Message-----
From: public-exi-request@w3.org [mailto:public-exi-request@w3.org] On Behalf
Of Taki Kamiya
Sent: Thursday, May 15, 2008 5:56 AM
To: santhana@huawei.com; public-exi@w3.org
Subject: 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:



In the case of the production "TypeUri_0: CH [schema-valid-value]

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



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:


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,







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: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



           CH [schema-valid-value] TypeUri_1










For element MyUri







For element MyString





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



           CH [schema-valid-value] xs:string_1










After all this grammar definitions still there is some ambiguity in the

of TypeUri. It is lacking the schema basic type information unlike the

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,



Received on Thursday, 15 May 2008 14:15:49 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:52:42 UTC