users@jaxb.java.net

Re: Theoretically inherited attribute not found, ????

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 20 May 2003 08:19:03 -0700

Laura Ferguson <allenderl_at_acm.org> wrote:
> In my schema, I've defined a ComplexType "GroupElement" which has multiple
> child classes such as "Label", I must be doing something wrong, because I
> keep getting a "unexpected attribute" validation error on the xml I'm
> generating with ObjectFactory. Any ideas on what is causing this
> error? (I've inlined the error message, the relevant parts of the schema
> and the generated xml below.) Many Thanks, Laura Ferguson allenderL_at_acm.org

I think a similar bug is reported before, about the handling of a
complex type extended from another complex type.

I think we've fixed it, but if you could send a schema to me, I'd be
happy to test it to make sure it's really fixed.

> But it seems like "width" should be expected because in my schema
> definition I have the following ComplexType defined:
>
> <xsd:complexType name="GroupElement">
> <xsd:attribute name="x" type="pdlInteger" use="optional" default="0"/>
> <xsd:attribute name="y" type="pdlInteger" use="optional" default="0"/>
> <xsd:attribute name="width" type="pdlPositiveInteger" use="optional"
> default="114"/>
> <xsd:attribute name="height" type="pdlPositiveInteger" use="optional"
> default="52"/>
> </xsd:complexType>
>
> Which is then inherited by multiple child classes like this one:
> <xsd:element name="Label">
> <xsd:complexType>
> <xsd:complexContent>
> <xsd:extension base="GroupElement">
> <xsd:sequence>
> <xsd:element name="dataElement" type="TextDataElement"/>
> <xsd:sequence>
> <xsd:annotation>
> <xsd:appinfo>
> <jxb:property name="comments"/>
> </xsd:appinfo>
> </xsd:annotation>
> <xsd:element ref="Comment" minOccurs="0"
> maxOccurs="unbounded"/>
> </xsd:sequence>
> </xsd:sequence>
> </xsd:extension>
> </xsd:complexContent>
> </xsd:complexType>
> </xsd:element>
>


regards,
--
Kohsuke KAWAGUCHI                  408-276-7063 (x17063)
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com