|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XML Schemas: <all> + extension = ?
"Henry S. Thompson" wrote: > Can't be done as the design stands. Derived types observe one of two > invariants: > > restriction) all members of derived type are members of base type > extension) all members of derived type contain members of base type as > a prefix. Note that "prefix" here is not anything to do with the namespace prefix. Roughly it means that a complex type derived by extension has the declarations take from the base first (i.e., the prefix) then the new declarations (i.e., the suffix). Programmers will see that this constraint makes implementation simple: the derived-by-extension type can use the classes or structures created for the base type without change. For example, the class/struct implementing the derived type could simply have an object/pointer of the class/struct implementing the base type as a member; or every class implementing a base type could have a member/pointer in which extensions could be chained. (In some languages, the class implementing the base class could be simply subclassed to add slots/accessors for the new members.) Another result of this are that if I compile the XML Schema for a complex type into record-like structures accessed by byte-offset, then the same offsets would work with types and derived types. (Of course, the more complex the content model, the less this is useful: but certainly it can be useful for accessing attributes and flat content models with fixed occurences.) Certainly one of the hopes of XML Schemas is to allow schemas with declarations (at least closed declarations) to be compilable into very efficient forms for database-like access. It may well be that with experience we find that the extensions-are-suffixes rule is not necessary for efficiency; until this can be conclusively ruled out, limiting extension to "suffixation" is reasonable IMHO. (B.T.W., has anyone released a good tutorial about type substituability and XML Schemas?) Rick Jelliffe *************************************************************************** This is xml-dev, the mailing list for XML developers. To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev List archives are available at http://xml.org/archives/xml-dev/ ***************************************************************************
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








