RE: Duplicate element definitions

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 UTC