users@jaxb.java.net

Losing namespace prefixes on attributes when marshalling to DOM [More Info]

From: Mark D. Hansen <khookguy_at_yahoo.com>
Date: Thu, 08 May 2003 09:20:19 -0400

Perhaps this has something to do with the fact that JAXB implements the
"AckRequested" element as an xxxxType (i.e., does not implement the
javax.xml.bind.Element interface). Here is a portion of the schema:

<xsd:element name="ReliableMessage">
  <xsd:complexType>
    <xsd:sequence>
         ...
         ...
      <xsd:element ref="ns1:AckRequested" minOccurs="0"/>
         ...
    </xsd:sequence>
    <xsd:attribute ref="soap:mustUnderstand" use="required"/>
  </xsd:complexType>
</xsd:element>

<xsd:element name="AckRequested">
  <xsd:complexType>
    <xsd:attribute name="synchronous" type="xsd:boolean" use="optional"
default="false"/>
  </xsd:complexType>
</xsd:element>

Any help would be appreciated!

============================================

Has anyone seen this before - and/or know a solution?

I am having a problem that when I marshal to a DOM, I lose the namespace
prefixes on the attributes of some elements.

In this example, the attribute "synchronous" in the element
AckRequested, has lost its prefix:

<ns2:ReliableMessage ns1:mustUnderstand="1"
xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns2="http://schemas.fujitsu.com/rm">
  <ns2:ReplyTo>http://eai-client2:8080/ARL</ns2:ReplyTo>
  <ns2:AckRequested synchronous="false"/>
</ns2:ReliableMessage>