On 7/24/09 3:19 PM, Wolfgang Laun wrote:
>
>
> On Fri, Jul 24, 2009 at 2:38 PM, Vladimir Blagojevic <dovlex_at_gmail.com
> <mailto:dovlex_at_gmail.com>> wrote:
>
> Hi,
>
> Is there a way to force schema generator not to attach
> use="required" for every attribute of primitive type except of
> course to use Java primitive wrappers?
>
>
> Try the annotation
> @XmlAttribute( required="false" )
>
I tried that first with no luck. Is it maybe jaxb version dependent?
>
> How can we specify default values for attributes so they can be
> reflected in generated schema?
>
>
> No way. But if you go from Java to schema, your Java code would have
> to implement the default anyway.
> -W
>
True, except I have to follow a logic that whenever element is present
in xml it should set certain default values for attributes and when it
is not present it should not. Any idea how to deal with this?
Thanks,
Vladimir