If an attribute that is defined as an enumerated list is missing from an XML element should the first value in the list be used as a default if it doesn't have a default specified?
I have the following in a schema:
<xsd:simpleType name="YesNoType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="yes"/>
<xsd:enumeration value="no"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="TelephoneStructure">
<xsd:sequence>
<xsd:element name="TelNationalNumber" type="core:TelephoneNumberType"/>
<xsd:element name="TelExtensionNumber" type="core:TelephoneExtensionType" minOccurs="0"/>
<xsd:element name="TelCountryCode" type="core:TelCountryCodeType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="TelUse" type="core:WorkHomeType"/>
<xsd:attribute name="TelMobile" type="core:YesNoType"/>
<xsd:attribute name="TelPreferred" type="core:YesNoType"/>
</xsd:complexType>
I have generated C# types from the above schema. I expected that missing attributes would result in null values, but I find that missing attributes default to the first value in the list, is this correct according to the XML spec?