users@jaxb.java.net

inhereted default overrides do not work

From: Simuni, Ilya <Ilya.Simuni_at_gs.com>
Date: Thu, 03 Apr 2003 17:13:29 -0500

I have created a base complex type hoping that I can use it in many elements
and set some attribute values using default attribute in the derived
elements.
This schema parses fine, but when I created parser code, no default or fixed
values were set.

In the class Node2Type, the function getName() returns "Undefined" instead
of "Node 2 Name".
It appears that the "Name" attribute is always set to default in the base
type
and the fixed attribute was not set at all.

Any ideas or suggestions ?

---------------------------------------------------------------------
here are the definitions:

 <xsd:complexType name="BaseNodeType">
  <xsd:attribute name="Binding" type="xsd:NMTOKEN"/>
  <xsd:attribute name="Name" type="xsd:string" default="Undefined"/>
  <xsd:attributeGroup ref="apv:NodeAttributeGroup"/>
 </xsd:complexType>

<xsd:element name="Node2">
  <xsd:complexType>
   <xsd:complexContent>
    <xsd:restriction base="apv:BaseNodeType">
     <xsd:attribute name="Binding" type="xsd:NMTOKEN" fixed="Node2Binding"/>
     <xsd:attribute name="Name" type="xsd:string" default="Node 2 Name"/>
    </xsd:restriction>
   </xsd:complexContent>
  </xsd:complexType>
 </xsd:element>