Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331706

Summary: QName property not marshalling correctly when namespace is not in NamespaceResolver
Product: z_Archived Reporter: Blaise Doughan <blaise.doughan>
Component: EclipselinkAssignee: Blaise Doughan <blaise.doughan>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.oxm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Core - Fix
none
MOXy - Test Cases
none
Core - Fix
none
Core - Fix
none
Core - Fix (to address re-open) none

Description Blaise Doughan CLA 2010-12-02 13:41:27 EST
When marshalling a QName property, if the namespace URI is not in the NamespaceResolver only the localName is marshalled.  Instead a prefix for that namespace should be generated and declared on the owning element.
Comment 1 Blaise Doughan CLA 2010-12-02 13:42:25 EST
Created attachment 184377 [details]
Core - Fix
Comment 2 Blaise Doughan CLA 2010-12-02 15:41:54 EST
Created attachment 184398 [details]
MOXy - Test Cases
Comment 3 Blaise Doughan CLA 2010-12-02 15:43:05 EST
Created attachment 184399 [details]
Core - Fix
Comment 4 Blaise Doughan CLA 2010-12-03 10:46:47 EST
Created attachment 184473 [details]
Core - Fix
Comment 5 Blaise Doughan CLA 2010-12-03 10:59:49 EST
Fix checked into trunk at rev:  8621

Code reviewed by:  Matt MacIvor

1.  The getStringForQName on MappingNodeValue now takes a MarshalRecord as a parameter.  This was done because the QName value may necessitate a namespace declaration to be done.  This change required changes to the classes that called this method.
2.  ContentHandler record now calls the appropriate endPrefix mapping events.
Comment 6 Blaise Doughan CLA 2010-12-03 14:03:27 EST
There is a bug when the QName does not have a namespace URI, it causes the object to marshal as follows:

<test>
   <foo xmlns:ns0="">ns0:foo</foo>
</test>
Comment 7 Blaise Doughan CLA 2010-12-03 14:05:39 EST
Created attachment 184500 [details]
Core - Fix (to address re-open)

Previously we were checking for a null namespace URI, now we also check for an empty string namespace URI.
Comment 8 Blaise Doughan CLA 2010-12-03 14:07:57 EST
Secondary fix checked into trunk at rev: 8622
Comment 9 Eclipse Webmaster CLA 2022-06-09 10:05:48 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink