users@jaxb.java.net

marshalling problem with QName in attribute

From: Jonathan Sergent <Jonathan.Sergent_at_Sun.COM>
Date: Fri, 03 Jan 2003 17:41:29 -0800

My schema has this type:

   <complexType name="StatusType">
     <attribute name="code" type="QName" use="required"/>
     <attribute name="reason" type="QName" use="optional"/>
   </complexType>

When JAXB marshals the resulting objects, I get something like this:

<ns2:xxx xmlns:ns2="urn:foo">
<ns2:status code="ns3:success"></ns2:status>
</ns2:xxx>

Note that the QName object I pass into setCode has the same
namespaceURI that ns2 does. No namespace declaration for ns3 is
present. The unmarshaller fails on this, as I would expect...

Can anyone explain what's going wrong? Thanks.

--
Jonathan Sergent / sergent_at_Sun.COM