Re: Complex Type Definition Schema Component (Structures)

"Jeff Rafter" <jeffrafter@definedweb.com> writes:

> I started to try to implement the structures portion of the spec. and am
> finding that certain aspects of some of the schema components don't always
> transfer cleanly to OO programming languages.  An example of this would be
> the Complex Type Definition Schema Component [1].  The property "{content
> type}" seems to have multiple types-- it could be a constant (string, int,
> enumeration, etc.) for "empty, mixed, element-only" or it can be a simple
> type definition or content model-- both of which are Schema Components.  How
> to represent this as a single property in an object without the use of a
> variant escapes me. It seems that adding a property "{content model}" would
> clear this up in a case such as this.  Then "{content type}" could be any of
> "empty, simple, mixed, element-only" and "{content model}" could be a
> reference to a Schema Component (in which case it would be either a simple
> type or a content model), or absent.
> 
> Has anyone else noticed this or wished, as I have, that another property was
> added?  I know I could easily add these properties to my implementation but
> I am trying to be very strict in naming and representation of the Schema
> Components.

As Jason says, you can't be strict about this in a strongly typed
language.  XSV uses two instance variables just as you suggest, and
Python isn't even strongly typed :-).

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Saturday, 24 February 2001 16:20:28 UTC