RE: SE(*) in DocGrammar under strict mode

Gengo-san,

Thank you for your careful review of the EXI specification and for your
question about the Document Grammars. 

You are correct that in strict mode, EXI generally removes items from the
grammar that are not required by schema-valid documents. So, it can be a
bit surprising that the Schema-Informed Document Grammar accepts the SE(*)
event, which is normally used for schema-invalid elements or wildcards. 

As it turns out, the SE(*) production is actually required in this context
for accepting certain schema-valid documents. In particular, the XML Schema
specification allows the root element of a document to have *any* name as
long as the element has a valid xsi:type attribute that can be resolved to
a type definition in the schema. So, for example, the following document is
actually a schema-valid SOAP 1.1 message:

   <MyEnvelope xsi:type="soapenv:Envelope"
                xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
         <ns1:getPrice xmlns:ns1="http://quickstart.samples/xsd">
            <ns1:symbol>ABC</ns1:symbol>
         </ns1:getPrice>
      </soapenv:Body>
   </MyEnvelope>

even though the element <MyEnvelope> is not defined in the SOAP schema (you
can try this with your favorite XML Schema validator). 

Consequently, the Schema-Informed Document Grammar must accept the SE(*)
event to accommodate all schema-valid XML documents. See rule 1.2  of the
section entitled "Validation Rule:Schema-Validity Assessment (Element)" [1]
in the XML Schema specification for more details on this.

I hope this answer is helpful. Thank you again for your question.

	Best wishes,

	John

[1] http://www.w3.org/TR/xmlschema-1/#cvc-assess-elt

AgileDelta, Inc.
john.schneider@agiledelta.com
http://www.agiledelta.com 

> -----Original Message-----
> From: public-exi-comments-request@w3.org 
> [mailto:public-exi-comments-request@w3.org] On Behalf Of Gengo Suzuki
> Sent: Thursday, June 25, 2009 6:22 PM
> To: public-exi-comments@w3.org
> Subject: SE(*) in DocGrammar under strict mode
> 
> Hello, 
> 
> I have an question about Document Grammars.
> 
> In 8.5.1 Schema-Informed Document Grammar, there is 'SE(*)' 
> event which is evaluated by 'Built-in' Element Grammar.
> 
> But this rule (perhaps) can be applied under strict mode.
> 
> I think the principle of strict mode is that  if XML instance 
> has an element which isn't defined in XML schema, encoder 
> should stop with some error.
> 
> I feel lacking of  consistency   between Schema-Informed Document
> Grammar specification and strict mode.
> 
> How do you think about it?
> Or were there any arguments?
> 
> Regards, 
> 
> //---------------------------------------------------------------
> NTT Cyber Space Laboratories
> Gengo Suzuki <suzuki.gengo@lab.ntt.co.jp>
> TEL: +81-46-859-3412ˇˇFAX: +81-46-859-2768 
> ----------------------------------------------------------------//
> 
> 
> 

Received on Wednesday, 15 July 2009 18:45:29 UTC