IIRC, it actually works. Try the getUserId() API and see if it returns
"na".
If it works, I agree that the Javadoc is buggy. Log a bug.
Cheers, Han Ming
On Tuesday, May 6, 2003, at 06:18 AM, Arek Stryjski wrote:
> I have this XML schema fragment:
>
> <xsd:complexType name="AutodebugMeta">
> <xsd:sequence>
> <xsd:element name="body-type" type="BodyType" default="test" />
> <xsd:element name="dealer-id" type="xsd:string"/>
> <xsd:element name="user-id" type="xsd:string" default="na"/>
> <xsd:element name="res-id" type="xsd:string" default="na"/>
> <xsd:element name="time" type="xsd:dateTime"/>
> </xsd:sequence>
> </xsd:complexType>
>
> In genereted class I got:
>
> /**
> * Java content class for AutodebugMeta complex type.
> * <p>The following schema fragment specifies the expected content
> contained
> within this java content object.
> * <p>
> * <pre>
> * <complexType name="AutodebugMeta">
> * <complexContent>
> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
> * <sequence>
> * <element name="body-type" type="{}BodyType"/>
> * <element name="dealer-id"
> type="{http://www.w3.org/2001/XMLSchema}string"/>
> * <element name="user-id"
> type="{http://www.w3.org/2001/XMLSchema}string"/>
> * <element name="res-id"
> type="{http://www.w3.org/2001/XMLSchema}string"/>
> * <element name="time"
> type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
> * </sequence>
> * </restriction>
> * </complexContent>
> * </complexType>
> * </pre>
> *
> */
>
> Well I don't agree with sentence: "The following schema fragment
> specifies
> the expected content".
>
> I don't understand why generated code does not take default values? Is
> something wrong with my schema, or JAXB does not support this. It will
> be
> very strange if this will be not supported in version 1.0 because as
> far as
> I remember it was working in JAXB-ea for DTD.
>
> Regards
> Arek