[www-xml-schema-comments] <none>

Dear Sirs:

I would like for you to consider, during the current revision of the XML 
Schema work, to add the ability to extend xs:all groups in a very specific 
way.

I have the need (as I suspect many others do) to represent instances of 
object classes in XML.   By object classes, I mean general modeling 
constructs where properties are grouped according to a classification 
system ... such as that used by the Common Information Model from the DMTF 
or Java classes.   For example, suppose I have the following two classes 
defined:

Class "Hardware" with properties "Height", "Width", "Depth", 
"SerialNumber", "Manufacturer"
Class "ComputerSystem" derived from "Hardware" with additional properties 
"Architecture", "Memory", "DiskStorage"

Since it is commonly understood that properties of object classes can be 
specified in any order (in fact, imposing an order on the properties is 
problematic), I have naturally expressed an instance of the Hardware class 
using something like the following XML syntax described in XML schema 
(note the use of xs:all to allow the properties to be specified in any 
order):

    <xs:complexType name="Hardware">
        <xs:all>
            <xs:element name="Height" type=xs:string minOccurs="0"/>
            <xs:element name="Width" type=xs:string minOccurs="0"/> 
            <xs:element name="Depth" type=xs:string minOccurs="0"/> 
            <xs:element name="SerialNumber" type=xs:string minOccurs="0"/> 

            <xs:element name="Manufacturer" type=xs:string minOccurs="0"/> 

        </xs:all>
    </xs:complexType>

So for the subclass ("ComputerSystem")  I would like to define the XML 
syntax in such a way that it is derived from that for Hardware.  I would 
like to do is somehting similar to the following:

    <xs:complexType name="ComputerSystem">
        <xs:complexContent>
            <xs:extension base="Hardware">
                <xs:all>
                    <xs:element name="Architecture" type=xs:string 
minOccurs="0"/>
                    <xs:element name="Memory" type=xs:string 
minOccurs="0"/> 
                    <xs:element name="DiskStorage" type=xs:string 
minOccurs="0"/> 
                </xs:all>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

In other words, I would like to add additional properties to the xs:all 
group in the derived type, with the properties still adhering to the 
restrictions for an xs:all group in general (zero to one occurrences, 
etc.) but being able to specify any of the properties in ComputerSystem 
(both explicit and inherited) in any order.  Additionally, I would like to 
make elements that have a type of ComputerSystem be in a substitution 
group for elements with the Hardware type ... which should be possible if 
I am allowed to extend the xs:all group construct ... but this is not 
allowed at present.

As you can see, this is a very useful and commonly occurring construct ... 
and I believe this simple relaxation of the restiction where xs:all groups 
cannot be derived will cause greater acceptance of  XML schema in the data 
modeling community or by anyone else that uses object-oriented concepts in 
their design.  I also believe it does not unduly increase the complexity 
of the parsing beyond what currently exists for xs:all groups (other than 
having to follow the derivation links to see what elements are allowed in 
the group).

Thank you for your consideration of this change,

Robert Nielsen | Tivoli Data Model Architect | IBM Software group | Tivoli 
Software | 919.224.1355 | rnielsen@us.ibm.com

Received on Wednesday, 13 April 2005 00:54:10 UTC