W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2002

Question about different content-model for element w/ same name

From: Jeroen Koops <jeroen@empanda.net>
Date: Mon, 22 Jul 2002 23:15:23 +0200 (CEST)
To: xmlschema-dev@w3.org
Message-ID: <Pine.LNX.4.10.10207222310150.19444-100000@jamaica.mousedragevent.com>

Hello,

The schema-specification includes the following example:

<xs:element name="contextOne">
 <xs:complexType>
  <xs:sequence>
   <xs:element name="myLocalElement" type="myFirstType"/>
   <xs:element ref="globalElement"/>
  </xs:sequence>
 </xs:complexType>
</xs:element>

<xs:element name="contextTwo">
 <xs:complexType>
  <xs:sequence>
   <xs:element name="myLocalElement" type="mySecondType"/>
   <xs:element ref="globalElement"/>
  </xs:sequence>
 </xs:complexType>
</xs:element>

This example demonstrates the possibility to use different content-models
for two elements with the same name, depending on their context.

My question is: is it also allowed for elements with the same name to use
different content-models, _without_ the possibility to make a distinction
based on their context, as in:

<xs:element name="...">
 <xs:complexType>
  <xs:choice>
   <xs:element name="myName" type="myFirstType"/>
   <xs:element name="myName" type="mySecondType"/>
  </xs:choice>
 </xs:complexType>
</xs:element> 

Many thanks,
--
Jeroen Koops
Empanda Software Development
jeroen@empanda.net
+31-6-24686577
Received on Monday, 22 July 2002 17:15:26 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:57 UTC