- From: David Beech <dbeech@us.oracle.com>
- Date: Fri, 19 May 2000 12:21:08 -0700
- To: www-xml-schema-comments@w3.org
- CC: simeon@research.bell-labs.com, w3c-xml-query-wg@w3.org
petsa@us.ibm.com wrote: > Jerome: > I will respond to only one of your comments: the request for > abstract types in 1.3 proposal 2. You would like to write > > <authors> > <author>Serge Abiteboul</author> > <author>Peter Buneman</author> > <author><first>Dan</first><last>Suciu</last><author> > <authors> > > where the contents of the <author> elements are governed by 2 different > subtypes > of an abstract base type. This is a reasonable request but consider the > validator. > It comes upon an <author> element and only knows that it is of type > declared for > <author> or one of its subtypes but it does not know *which* of its > subtypes. So, > essentally, it has to *search* all the subtypes of author to find whether > the content it > finds fits any one of the subtypes. We thought this could become very > expensive and > so required as explicit indication of the type via the xsi:type attribute. > I believe SQL > also requires such a "most specific type" indicator. SQL-99 (and languages like Java and C++) require the user to employ a constructor for the specific type or class they are instantiating, and then the implementation saves that information somewhere. It pops up explicitly when you serialize or otherwise transfer the data. In an XML instance, we are either instantiating directly into the document, or we are in the serialization/transfer situation, and the information appears explicitly so that it is not lost. > As I pointed out in my note to Phil, adding another level of nesting that > includes the > specific type: > > <authors> > <author> > <simpleAuthor> Serge Abiteboul</author> > ... > > is IMHO no better and no worse. This style also generally requires schema assistance to know which element names "indicate" type names and which do not (and whether "indicate" means "are lexically the same as" or not). Thanks, David
Received on Friday, 19 May 2000 15:20:56 UTC