W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2000

For the records: LC issue 92

From: Mary Holstege <holstege@calico.com>
Date: Wed, 20 Sep 2000 04:54:17 -0700
To: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
Message-ID: <20000920115416.AAA4810@sjd-ex001.calico.com>

The following message was sent to the commentator July 11th; no reply was
received.

//Mary

From: "Mary Holstege" <holstege@calico.com>
To: bahreininejad@yahoo.com
Subject: XML Schemas "Dynamic element name specification"
Date: Tue, 11 Jul 2000 12:12:17 -0700
X-Mailer: VM 6.40 under Emacs 19.34.1
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


I am responding to you on behalf of the XML Schemas Working Group about your
comments on dynamic element name specification, which we have categorized as LC
issue 92 [1]. I apologize for the delay in responding. As you can imagine, we
have had a large number of comments and questions to work through.

Your comment was [2]:
> I wish to define an element in a schema document where the "name" of the
> element is not known. Let's say, the name of the element may be decided 
> by other parties using the schema for example: 
>                <element name="Cat"/>
>                <element name="Dog"/> 
>                <element name="????"/> 
> 
> 
> where a different user may decide on the ????. How do we define such dynamic
> name allocation?  

We believe this can be accomplished in XML Schemas. The equivClass mechanism
(see section 4.5 of Part 0 [3]) gives the most general form of 
substitutability:

    <element name="Pet" type="Pet" abstract="true"/>
    
    <element name="Cat" equivClass="Pet">
        ...definition of Cat
    </element>

    <element name="Dog" equivClass="Pet">
        ...definition of Dog
    </element>

Any element can be defined as being in the "Pet" class, and content models that
refer to "Pet" will then permit any member.

    <element name="MeAndMyPets">
        <complexType>
            <element name="Me" minOccurs="1" type="dt:String"/>
            <element ref="Pet" minOccurs="0" maxOccurs="unbounded"/>
        </complexType>
    </element>

An instance fragment would be something like:

<MeAndMyPets>
    <Me>Mary</Me>
    <Cat>cat stuff, however Cat was defined...</Cat>
    <Dog>dog stuff, however Dog was defined...</Dog>
    ... etc.
</MeAndMyPets>

Please let us know if this answer is insufficient.

[1] http://www.w3.org/2000/05/12-xmlschema-lcissues.html
[2] http://lists.w3.org/Archives/Public/www-xml-schema-comments/2000AprJun/0131.html
[3] http://www.w3.org/TR/xmlschema-0/

	-- Mary
	   Holstege@calico.com

| Mary Holstege, PhD
| Distinguished Engineer                  holstege@calico.COM
| Calico Commerce                         (408) 278-7367
| 333 W. San Carlos, Suite 300            (408) 278-8498 (fax)
| San Jose, CA 95110                      http://www.calico.COM/
Received on Wednesday, 20 September 2000 07:54:35 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:53 UTC