users@jaxb.java.net

Attributes of base type not recognized in validation

From: Xin Ma <xin.ma_at_e2open.com>
Date: Fri, 25 Apr 2003 08:36:10 -0700

For a type A that extends type B as shown below,

        <xsd:complexType name="A">
                <xsd:complexContent>
                        <xsd:extension base="B"/>
                </xsd:complexContent>
        </xsd:complexType>

        <xsd:complexType name="B">
                <xsd:attribute name="attr" type="xsd:string"
use="required"/>
        </xsd:complexType>

JAXB validation of <A attr="x"/> fails with the following error:

DefaultValidationEventHandler: [ERROR]: unexpected attribute "attr"

Apprently, the attribute 'attr' defined in the base type 'B' is not honored
when validating type 'A'.
Is this a known issue?

Thanks