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

RE: Duplicate element definitions

From: Dare Obasanjo <dareo@microsoft.com>
Date: Tue, 22 Jul 2003 09:18:41 -0700
Message-ID: <830178CE7378FC40BC6F1DDADCFDD1D1173AF6@RED-MSG-31.redmond.corp.microsoft.com>
To: "Paul Warren" <pdw@decisionsoft.com>, <xmlschema-dev@w3.org>

Schema Component Constraint: Element Declarations Consistent 

If the {particles} contains, either directly, indirectly (that is, within the {particles} of a contained model group, recursively) or ·implicitly· two or more element declaration particles with the same {name} and {target namespace}, then all their type definitions must be the same top-level definition, that is, all of the following must be true: 
1 all their {type definition}s must have a non-·absent· name. 
2 all their {type definition}s must have the same name. 
3 all their {type definition}s must have the same target namespace. 

________________________________

From: xmlschema-dev-request@w3.org on behalf of Paul Warren
Sent: Tue 7/22/2003 8:44 AM
To: xmlschema-dev@w3.org
Subject: Duplicate element definitions




Can anyone explain why (according to sqc) the repeated definition of
element1 is acceptable, but that of element2 is not.  According to sqc,
the definition of duplicateTest "contains directly, indirectly or
implicitly the following element declarations with same name and
targetNamespace but with different type definition" referring to the
definitions of element2.

I can't seem to find any reference to this behaviour in the spec.

<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'
elementFormDefault="qualified"
>

  <xsd:element name="duplicateTest" >
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="element1" type="fooTest" />

        <xsd:element name="element2" >
          <xsd:complexType >
            <xsd:sequence >
              <xsd:element name="inner1c" />
              <xsd:element name="inner2d" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>

        <xsd:element name="element1" type="fooTest" />

        <xsd:element name="element2" >
          <xsd:complexType >
            <xsd:sequence >
              <xsd:element name="inner1c" />
              <xsd:element name="inner2d" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>

      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>


  <xsd:complexType name="fooTest">
     <xsd:sequence >
        <xsd:element name="inner1a" />
        <xsd:element name="inner2b" />
     </xsd:sequence>
  </xsd:complexType>

</xsd:schema>


thanks,

Paul
--
Paul Warren, Client Services           DecisionSoft Limited
+44-1865-203192                        http://www.decisionsoft.com
Received on Tuesday, 22 July 2003 12:18:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:39 GMT