OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: XML Schemas: Best Practices

[ Lists Home | Date Index | Thread Index ]
  • From: "Roger L. Costello" <costello@mitre.org>
  • To: xml-dev@lists.xml.org
  • Date: Thu, 14 Dec 2000 14:41:25 -0500

Hi Folks,

[1] I would like to put on hold the topic of "Capturing Semantics of XML
Schema Components".  I realize now that that is a huge topic and it is
probably best to hold off on it till after the holidays.

[2] I gave a talk last week at XML 2000 on the results of our Best
Practices discussions.  An on-line version of the talk may be found at: 


[3] The issue that I would like to start on now is: "Use Cases for
element substitution".  I would like for us to collectively come up with
a set of use cases for where it is appropriate to use element

First, let's recall what element substitution is all about.  Element
substitution allows you to create an element that can substitute for
another element in an instance document.


In the below example I declare an element, metro, which can substitute
for subway in instance documents:

    <element name="subway" type="string"/>
    <element name="metro" substitutionGroup="a:subway"/>
    <element name="transportation">
                 <element ref="a:subway"/>

Here's an instance document which uses <subway>:

        <subway>Red Line</subway>

Since metro can substitute for subway, here is another instance document
where <transportation> contains <metro>:

        <metro>Red Line</metro>

Thus, this example shows how the subway element may be substituted by
the metro element.

Is this subway/metro example a good use case for element substitution?

It occurred to me that one use case for element substitution is for
allowing instance document tags to be expressed in different languages.

For the above example I could use element substitution to enable
instance document authors to express <transportation> or <subway> in
either English or German:

   <element name="subway" type="string"/>
   <element name="Fußgängerunterführung" substitutionGroup="a:subway"/>
   <complexType name="transport">
             <element ref="a:subway"/>
   <element name="transportation" type="a:transport"/>
   <element name="Beförderung" substitutionGroup="a:transportation"/>

Now someone could create an instance document and use either English or
German tags.  For example, here an instance document is expressed in

        <Fußgängerunterführung>Rot zeile</Fußgängerunterführung>

Is this a good use case for element substitution?

What are other good use cases for element substitution?  I would like
for us to compile a list of use cases.  /Roger


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS