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

Bug 335351

Summary: Issue marshalling QName with "" namespace.
Product: z_Archived Reporter: Matt MacIvor <matt.macivor>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed Fix
none
Proposed Fix and Tests none

Description Matt MacIvor CLA 2011-01-25 12:33:34 EST
When marshalling a QName, if the QName has "" or null for a namespace, the local name is written out as the value without a prefix. This works in most cases, however, if there's a default namespace declared somewhere above in the document, then the value will be incorrect.

EclipseLink needs to cancel out the previous default namespace declaration in the scope of this element by adding xmlns="".
Comment 1 Matt MacIvor CLA 2011-01-25 14:35:36 EST
Created attachment 187561 [details]
Proposed Fix
Comment 2 Matt MacIvor CLA 2011-01-28 12:59:11 EST
Attached path checked in to SVN
Reviewed by David McCann
Comment 3 Matt MacIvor CLA 2011-02-18 16:11:44 EST
Reopening to track an additional problem.

If there's a default namespace declared already in the document, and the owning element is in that namespace (non-prefixed), then adding the xmlns="" will break the namespace of that element.

If this situation arises, the element will have to have a prefix generated for it's namespace so that the xmlns="" can still be added to handle the namespace of the qname value.
Comment 4 Matt MacIvor CLA 2011-02-18 16:16:03 EST
Created attachment 189323 [details]
Proposed Fix and Tests
Comment 5 Matt MacIvor CLA 2011-02-22 13:46:20 EST
Updated patch checked in to SVN
Reviewed by Blaise Doughan
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:20:13 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink