Community
Participate
Working Groups
Given the model below we should get XML like this if we marshal a Root that has baseTypeThing set to an instance of SubType. <ns0:root xmlns:ns0="rootNamespace"><baseTypeThing xmlns:ns1="someNamespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:subType"/></ns0:root> but instead the xsi:type attribute is not adding hte ns1 prefix. @XmlRootElement(name="root", namespace="rootNamespace") public class Root { public BaseType baseTypeThing; } @XmlType(namespace = "someNamespace") public class BaseType { } @XmlType(namespace = "someNamespace") public class SubType extends BaseType{ }
Created attachment 207866 [details] Proposed changes and test
Patch checked in to 2.4 but should also be put in 2.3.3. Patch sets the prefix on the schema context qname so it is used by XMLObjectBuild but additionally need to investigate XMLObjectBuilder as a prefix should be generated if needed during marshal.
Created attachment 208586 [details] 2.3 patch
Also checked in 2.3 patch to 2.3.3
Created attachment 208958 [details] Additional test cases
Additional test cases patch checked in to 2.3 and trunk
Checked in to 2.3 and trunk and all tests passing. Wasn't able to find any cases where the prefix wasn't generated if needed.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink