This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4071 - particlesZ026 - duplicate attributes
Summary: particlesZ026 - duplicate attributes
Status: RESOLVED FIXED
Alias: None
Product: XML Schema Test Suite
Classification: Unclassified
Component: Microsoft tests (show other bugs)
Version: 2006-11-06
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Henry S. Thompson
QA Contact: XML Schema Test Suite mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-12 15:54 UTC by Michael Kay
Modified: 2010-04-05 17:03 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2006-12-12 15:54:00 UTC
In the Microsoft Particles test set, test group particlesZ026, the schema particlesZ026a.xsd has:

<xs:complexType name="ItemType" abstract="true">
  <xs:complexContent>
    <xs:extension base="StatementType">
       <xs:attribute name="StatementAssembly" type="xs:string"/>
       <xs:attribute name="StatementClass" type="xs:string"/>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

<xs:complexType name="ManagedItemType">
  <xs:complexContent>
    <xs:extension base="ItemType">
      <xs:attribute name="Assembly" type="xs:string" use="required" />
      <xs:attribute name="Class" type="xs:string" use="required" />
      <xs:attribute name="StatementAssembly" type="xs:string" />
      <xs:attribute name="StatementClass" type="xs:string"/>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

My reading of the spec is that this is invalid. The {attribute uses} on ManagedItemTypes consists of the union of the attributes defined in the two complexType declarations above. It's not defined exactly what "union" means (that is, how one decides whether two attribute uses are identical) but there is nothing in the spec to suggest eliminating attributes with duplicate names. The resulting schema component is therefore invalid under clause 5 of Schema Component Constraint: Complex Type Definition Properties Correct.

The test metadata reports this schema document as valid.
Comment 1 Zafar Abbas 2007-02-02 19:19:49 UTC
Agreed that the expected outcome of this test should be invalid. We are
following up with the WG to determine the process of updating the test suite.
Comment 2 Michael Kay 2008-06-22 15:39:22 UTC
We concluded that the spec deliberately doesn't say whether these attribute uses are identical and therefore it is implementation-dependent whether this schema is valid. We think it is worth keeping the test because it probes this area where implementations can differ, but the expected results should allow both interpretations of the spec.

Leaving it open for now because it's not immediately clear how to fix the tests.
Comment 3 Michael Kay 2010-02-26 16:45:37 UTC
Noted that in 1.1 there is a "scope" property on the attribute declaration component which makes the two attribute declarations distinct, and therefore the attribute uses are distinct, and therefore this derivation-by-extension is definitely invalid.

However, the spec still isn't very explicit in describing how to form the "union" of attribute uses.
Comment 4 David Ezell 2010-02-26 16:51:58 UTC
Resolution: Two versions of the test  particlesZ026; the one for 1.0 marked as
implementation-dependent, and the one for 1.1 marked as invalid.
Comment 5 Henry S. Thompson 2010-04-05 16:57:56 UTC
Made stable 1.1-only copy w. invalid schema test and no instance test.  Marked 
original as 1.0-only, implDe
Comment 6 Henry S. Thompson 2010-04-05 17:03:53 UTC
Made stable 1.1-only copy w. invalid schema test and no instance test.  Marked 
original as 1.0-only, implDe