W3C home > Mailing lists > Public > public-exi-comments@w3.org > November 2009

Re: EXI Special case grammar processing

From: Daniel Peintner <daniel.peintner@gmail.com>
Date: Tue, 3 Nov 2009 18:17:51 +0100
Message-ID: <abbf52e10911030917r12a45949seffd73cbb7147827@mail.gmail.com>
To: "Snyder, Sheldon (LT)" <slsnyder@nps.edu>
Cc: public-exi@w3.org, public-exi-comments@w3.org, "McGregor, Donald (Don) (CIV)" <mcgredo@nps.edu>, "Brutzman, Donald (Don) (CIV)" <brutzman@nps.navy.mil>
Hi Sheldon,

Thank you for your comment on the EXI specification.

> I am a student at NPS trying to build an implementation of EXI to
> prove/disprove its value to DoD. I am stuck on how to process nested
> elements with same Qname as in the example XML  below. I cannot find
> where in the specification this is explained/implied.

You are right that the currently available EXI specification may lead
to misinterpretation.
The text was revised and an updated publication will follow soon.

> <X3D>
>     <Transform rotation='1 0 0 0.4'>
>         <Transform rotation='0 0 1 0.5'/>
>     </Transform>
> </X3D>
> Is each Transform a new grammar, or are they all the same grammar?
> Either way, how should this be processed.

EXI may use schema knowledge to create grammars that describe the
content of XML elements. In accordance with XML Schema there may be
different grammars for the same element (e.g. global element
definitions vs. local-element definitions). Having said that, EXI (in
conformance with XML Schema) allows just one grammar for a global
element definition. This means the pool of global elements is uniquely
identified with a given qname. The list of global EXI element grammars is
initially pre-populated with global elements coming from a schema and
is expanded while processing with unknown qname grammars.

Given the example you gave it therefore depends whether you use schema
information and whether both "Transform" elements use the same
schema type.

When schemas are used and the first Transform is declared as
a global element in the schema, the grammar for the second
Transform is to be determined as follows:

- If the second Transform element is declared as a locally-defined
 element within the outer Transform element, the schema-informed
 element grammar built from the local element definition will be used.
 This grammar is not the same as the grammar used for the outer
 Transform element in this case.

- If the second Transform element is declared as a particle that uses
 the global Transform element, or it is a schema-deviation occurrence,
 it shares the same grammar as that of the outer Transform element.
 The grammar used in both cases are the same, and it is the one
 built from the global Transform element definition.

In schema-less mode the same "global" grammar is used for both
qualified names "Transform".

Hope this helps,

-- Daniel
Received on Tuesday, 3 November 2009 17:18:51 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:45:28 UTC