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 7352 - Default value of "nillable" on (local) element declarations in SD4SD
Summary: Default value of "nillable" on (local) element declarations in SD4SD
Status: CLOSED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.1 only
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: David Ezell
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords: resolved
Depends on:
Blocks:
 
Reported: 2009-08-17 16:37 UTC by Sandy Gao
Modified: 2009-10-02 15:34 UTC (History)
1 user (show)

See Also:


Attachments

Description Sandy Gao 2009-08-17 16:37:30 UTC
The default value for "nillable" in the schema for schemas can turn good schema documents into bad ones.

Consider:

<xs:schema ...>
  <xs:element name="global" .../>
  <xs:complexType ...>
    <xs:sequence>
      <xs:element ref="tns:global"/>

After validating against the SD4SD, a default value for "nillable" is added to the element reference:

      <xs:element maxOccurs="1" minOccurs="1" nillable="false" ref="tns:global"/>

But "nillable" isn't allowed on element refs [1].

It seems that we do not depend on the default value of "nillable" in the mapping rules. Section 3.3.2 has:

"{nillable}	The ·actual value· of the nillable [attribute], if present, otherwise false."

Suggest to remove such default value from the SD4SD, in both 1.0 and 1.1.

[1] http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#src-element clause 2.2
Comment 1 C. M. Sperberg-McQueen 2009-09-11 16:27:38 UTC
The WG today accepted this analysis and instructed the editors to fix it.
Comment 2 Sandy Gao 2009-09-18 13:04:41 UTC
Concrete proposal. In Appendix A, remove the default value on the attribute declaration for "nillable" from the complex type definition "element". i.e. remove default="false" from the following:

  <xs:complexType name="element" abstract="true">
    <xs:annotation>
      ...
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="xs:annotated">
        <xs:sequence>
          ...
        </xs:sequence>
        ...
        <xs:attribute name="nillable" type="xs:boolean" default="false"
                      use="optional"/>
        ...
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
Comment 3 Sandy Gao 2009-09-18 15:32:20 UTC
WG accepted proposal in comment #2 on 2009-09-18.