[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

duplicated element names in content model

From: Tobias Koenig <tobias.koenig@trolltech.com>
Date: Fri, 2 Jan 2009 16:10:09 +0100
To: xmlschema-dev@w3.org
Message-Id: <200901021610.09173.tobias.koenig@trolltech.com>
duplicated element names in content model

Hej,

the following schema
=========================================
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="doc" type="foo"/>
  <xsd:complexType name="foo">
    <xsd:sequence>
      <xsd:element name="e1" type="xsd:string"/>
        <xsd:choice>
          <xsd:choice>
            <xsd:element name="e1" type="xsd:integer"/>
          </xsd:choice>
        </xsd:choice>
      </xsd:sequence>
  </xsd:complexType>
</xsd:schema>
=========================================
is wrong according to the schema test suite and several validators.
But why exactly is it wrong? Does it violates the UPA constraint in some way?

When having a document

<doc>
  <e1/>
  <e1/>
</doc>

it seems to be possible to assign xsd:string to the first e1 and xsd:integer 
to the second, as both elements must appear at least once I can not see
any ambiguity here.
Is it explicitly stated somewhere in the schema spec or hidden inside an
algorithm?

Ciao,
Tobias
Received on Friday, 2 January 2009 15:09:39 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.