Hi All,
I was wondering if something is possible currently in JAXB v1.0.1.
The example schema fragment is :
<xs:element name="someElement" type="someElementType"/>
<xs:complexType name="someElementType">
<xs:attribute name="attr1example" type="xs:int"/>
</xs:complexType>
<xs:element name="someOtherElement" type="someOtherElementType"/>
<xs:complexType name="someOtherElementType">
<xs:all>
<xs:element ref="someElement"/>
</xs:all>
<!-- ... other things here -->
</xs:complexType>
This generates a someOtherElement class that has a method getSomeElement
with a return type of someElementType.
I was expecting the getSomeElement method to return a type of someElement.
I have an instance of someOtherElement and a method that takes as a
parameter someElement and I would like to pass the someElement contained in
someOtherElement to this method but this doesn't seem possible.
e.g.
ObjectFactory of = new ObjectFactory();
someOtherElement otherElem = of.createSomeOtherElement();
// Populate someOtherElement
...
// call method public void doSomething(someElement elem);
foo.doSomething(otherElem.getSomeElement()); // A compile error would
occur at this point.
Is there any solution to this issue? Do I need to expand the explanation
of my issue/question?
Thanks,
Phil