users@jaxb.java.net

Default attribute value for the inhereted from the restriction ty pe

From: Simuni, Ilya <Ilya.Simuni_at_gs.com>
Date: Wed, 26 Feb 2003 13:01:30 -0500

I have a base complex type which specifies an attribute with a default
value.
When I create an inhereted type using restriction, and set default value,
then the super type does not have that default type.

The question is: how to specify default value for the derived attribute?

Regards,
ilya

PS: Congratulations on releasing v1.0 JAXB is a great tool.

Here is the snippet of the schema:
<!---------------------------->
 <xsd:complexType name="BaseAttributeType">
  <xsd:attribute name="Name" type="xsd:string" default="Attribute"/>
 </xsd:complexType>

 <xsd:complexType name="DerivedAttributeType">
  <xsd:complexContent>
   <xsd:restriction base="apv:BaseAttributeType">
    <xsd:attribute name="Name" type="xsd:string" default="Title"/>
   </xsd:restriction>
  </xsd:complexContent>
 </xsd:complexType>
<!---------------------------->