users@jaxb.java.net

Re: jaxb code generation issue

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Sat, 4 Oct 2008 19:19:55 +0200

The base type wpc:tFromExtension has mixed="true", too.
Look for a field List<JAXBElement<?>> content in that class.
That's where your <xs:choice> elements will be after unmarshalling.

You might consider avoiding mixed="true".

-W


On Sat, Oct 4, 2008 at 6:13 PM, oxg1123 <oxg1123_at_yahoo.com> wrote:
> It looks like jaxb2 is ignoring xsd:choice within the xsd:extension. The code generation simply ignores it, not sure why.
>
> Any ideas?
>
>
> Please advice.
>
>
> XSD:
> <complexType name="tFrom" mixed="true">
> <complexContent>
> <extension base="wpc:tFromExtension">
> <sequence>
> <any namespace="##other" processContents="skip" minOccurs="0"/>
> <choice minOccurs="0">
> <element ref="bpws:query"/>
> <element ref="bpws:expression"/>
> <element ref="bpws:service-ref"/>
> </choice>
> </sequence>
> <attribute name="variable" type="NCName"/>
> <attribute name="part" type="NCName"/>
> <attribute name="property" type="QName"/>
> <attribute name="partnerLink" type="NCName"/>
> <attribute name="endpointReference" type="bpws:tRoles"/>
> <attribute name="opaque" type="bpws:tBoolean"/>
> </extension>
> </complexContent>
> </complexType>
>
>
>
> Generated code:
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "tFrom")
> @XmlRootElement(name = "from")
> public class TFrom
> extends TFromExtension
> {
> @XmlAttribute
> @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
> @XmlSchemaType(name = "NCName")
> protected String variable;
> @XmlAttribute
> @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
> @XmlSchemaType(name = "NCName")
> protected String part;
> @XmlAttribute
> protected QName property;
> @XmlAttribute
> @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
> @XmlSchemaType(name = "NCName")
> protected String partnerLink;
> @XmlAttribute
> protected TRoles endpointReference;
> @XmlAttribute
> protected TBoolean opaque;
>
> /**
> * Gets the value of the variable property.
> *
> * @return
>
>
> Thanks a lot
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>