dev@jaxb.java.net

JAXB javax.xml.bind.Binder updateXML problem on 12c

From: Brian Volpi <brian.volpi_at_oracle.com>
Date: Mon, 24 Sep 2012 15:02:57 -0700

SOA has a tool that is updating its model and using
**javax.xml.bind.Binder updateXML() to marshal. This code is working
fine under jdeveloper PS6. The same code is having a problem on
jdeveloper 12C. The updated XML has lost namespace declarations. For
example. before an update the xml looks like:

<ns0:definitions xmlns:ns0="http://schemas.oracle.com/events/edl"
targetNamespace="http://xmlns.oracle.com/Application13a/Project2/EventDefinition4">
<ns0:schema-import
location="../SCA-INF/classes/SOA/Schemas/singleString.xsd"
namespace="http://xmlns.oracle.com/singleString"/>
<ns0:event-definition name="Event1">
<ns0:content xmlns:ns1="http://xmlns.oracle.com/singleString"
element="ns1:singleString"/>
</ns0:event-definition>
</ns0:definitions>

After the update (of the name attribute), the xml looks like the
following. Notice that xmlns:ns1 declaration and the use of ns1 prefix
has been dropped.

<ns0:definitions xmlns:ns0="http://schemas.oracle.com/events/edl"
targetNamespace="http://xmlns.oracle.com/Application13a/Project2/EventDefinition4">
<ns0:schema-import
location="../SCA-INF/classes/SOA/Schemas/singleString.xsd"
namespace="http://xmlns.oracle.com/singleString"/>
<ns0:event-definition name="Event1XX">
<ns0:content element="singleString"/>
</ns0:event-definition>
</ns0:definitions>

Is this a known problem? Is there a workaround?