W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2003

Re: Venetian Salami?

From: Noah Mendelsohn/Cambridge/IBM <noah_mendelsohn@us.ibm.com>
Date: Mon, 31 Mar 2003 21:11:26 -0500
To: Jeni Tennison <jeni@jenitennison.com>
Cc: "Jack Lindsey" <Jack@Ottawa.com>, xmlschema-dev@w3.org
Message-ID: <OF8259632A.75ADBC3E-ON85256CFB.000C0B98@lotus.com>

Jeni Tennison suggests:

>> 2. Declare elements locally unless:

>>     a. they can be a document element
>>     b. they are or could be the head of a substitution group
>>     c. they are a member of a substitution group

I don't have strong feelings on this one way or the other in general.  I 
think different idioms will work will for different users.  That said, I 
think Jeni's otherwise good list misses one other obvious case:

* Declare elements global if you expect that they will be used in other 
vocabularies.

Substitution groups aren't the only means by which this can happen. 
Another schema might import your element and use it.  For example, one 
could imagine vocabularies for version control, designed to be embedded in 
a wide variety of other documents.   Surely at least the directly 
embeddable elements would be global.

There is one other more subtle use case;

* Declare elements global if you want to be able to do incremental 
validations of just those elements.  For example, in a container format 
like SOAP, one might well want to validate just the body.

There are probably some others along these lines.  Frankly, while I don't 
get to write a lot of schemas myself, I've always felt that local elements 
were somewhat over-emphasized, merely because they're convenient 
syntactically.  My view of the best reasons to use local elements are:

* You real intend them to have semantically local scope...I.e. they would 
be meaningless or ambiguous if used out of context. 

* You like elementForm="unqualified"

Again, I don't get to write nearly as many schemas as Jeni and co., so I'd 
take those last points with a grain of salt.  Thanks. 

------------------------------------------------------------------
Noah Mendelsohn                              Voice: 1-617-693-4036
IBM Corporation                                Fax: 1-617-693-8676
One Rogers Street
Cambridge, MA 02142
------------------------------------------------------------------
Received on Monday, 31 March 2003 21:19:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:36 GMT