Element not initialized with default when attributes are present

Sep 10, 2011 at 3:18 AM

For this XSD:

<xs:element name="AddOn" minOccurs="0" maxOccurs="unbounded" default="">
 <xs:complexType>
   <xs:simpleContent>
     <xs:extension base="xs:string">
       <xs:attribute name="type" type="xs:string" default="" />
     </xs:extension>
   </xs:simpleContent>
 </xs:complexType>
</xs:element>
Corresponding to an element like this:

<AddOn type="foo">bar</AddOn>

The default value for the element is not initialized:

    public AddOn()
    {
        this.typeField = "";
    }

Aaron.