users@jaxb.java.net

Duplicate element on marshall: element as type

From: Mike Horwitz <mike.horwitz_at_gmail.com>
Date: Thu, 16 Aug 2007 10:47:31 -0700 (PDT)

Search as I might, I cannot find an answer to the following:

I have a schema of the form:

<xsd:complexType name="FooType">
   <xsd:element name="Name" type="xsd:string"/>
</xsd:complexType>
<xsd:element name="Foo" type="tns:FooType"/>
<xsd:complexType name="BarType">
   <xsd:element name="Foo" type="tns:FooType"/>
</xsd:complexType>
<xsd:element name="Bar" type="tns:BarType"/>

Everything works fine in terms of compiling and unmarshalling.

Now I add an instance of FooImpl to a BarImpl instance, which works as
FooImpl extends FooType, and
I try and marshall and I get:

<Bar>
   <Foo>
      <Foo>
          <Name>name</Name>
      </Foo>
   </Foo>
</Bar>

Any ideas as to how fix?

Thanks

Mike Horwitz


-- 
View this message in context: http://www.nabble.com/Duplicate-element-on-marshall%3A-element-as-type-tf4281107.html#a12186206
Sent from the java.net - jaxb users mailing list archive at Nabble.com.