W3C home > Mailing lists > Public > public-xsd-databinding@w3.org > February 2006

Re: ISSUE-20: Extension of collections

From: Pete Cordell <petexmldev@tech-know-ware.com>
Date: Wed, 22 Feb 2006 08:02:59 -0000
Message-ID: <005901c63786$6b9ec370$b100a8c0@RW>
To: <public-xsd-databinding@w3.org>

Hi Paul,

My only comment on this is that the extension type could be a generic type, 
rather than defining an extension type for each collection.  In that case, 
you end up with:

 <xs:complexType name="CustomerType">
  <xs:sequence>
    <xs:element name="firstName" type="xs:string" />
    <xs:element name="lastName" type="xs:string" />
    <xs:element name="extension" type="tns:GenericExtensionType" 
minOccurs="0" />
  </xs:sequence>
  <xs:anyAttribute/>
 </xs:complexType>

 <xs:complexType name="MyOtherType">
  <xs:sequence>
    <xs:element name="Thingy" type="xs:string" />
    <xs:element name="extension" type="tns:GenericExtensionType" 
minOccurs="0" />
  </xs:sequence>
  <xs:anyAttribute/>
 </xs:complexType>

 <xs:complexType name="GenericExtensionType">
  <xs:sequence>
    <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"
          namespace="##targetNamespace"/>
    </xs:sequence>
 </xs:complexType>

This results in less generated code, and less clutter in the XSD.  It might 
be slightly confusing to developers that they can change the extension 
element to what they want later though.

Pete.
----- Original Message ----- 
From: "Databinding Issue Tracker" <dean+cgi@w3.org>
To: <public-xsd-databinding@w3.org>
Sent: Tuesday, February 21, 2006 2:05 PM
Subject: ISSUE-20: Extension of collections


>
>
> ISSUE-20: Extension of collections
>
> http://www.w3.org/2005/06/tracker/databinding/issues/20
>
> Raised by: Paul Downey
> On product: Basic
>
> The input document offers the following pattern for a collection
> which is open to extension, thereby being useful when evolving
> or extending a schema during versioning:
>
> """
> <xs:complexType name="CustomerType">
>  <xs:sequence>
>    <xs:element name="firstName" type="xs:string" />
>    <xs:element name="lastName" type="xs:string" />
>    <xs:element name="extension" type="tns:CustomerExtensionType" 
> minOccurs="0" />
>  </xs:sequence>
>  <xs:anyAttribute/>
> </xs:complexType>
>
> <xs:complexType name="CustomerExtensionType">
>  <xs:sequence>
>    <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"
>          namespace="##targetNamespace"/>
>    </xs:sequence>
> </xs:complexType>
>
> """
>
> How well is this pattern supported by tools - does it belong in
> the Basic patterns document?
>
> Are there authoring issues with this pattern we should warn about?
>
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
                         for XML to C++ data binding visit
                         http://www.tech-know-ware.com/lmx
                         (or http://www.xml2cpp.com)
=============================================
Received on Wednesday, 22 February 2006 08:03:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 18 December 2010 18:20:36 GMT