Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331706 - QName property not marshalling correctly when namespace is not in NamespaceResolver
Summary: QName property not marshalling correctly when namespace is not in NamespaceRe...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Blaise Doughan CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-02 13:41 EST by Blaise Doughan CLA
Modified: 2022-06-09 10:05 EDT (History)
1 user (show)

See Also:


Attachments
Core - Fix (7.02 KB, patch)
2010-12-02 13:42 EST, Blaise Doughan CLA
no flags Details | Diff
MOXy - Test Cases (6.32 KB, patch)
2010-12-02 15:41 EST, Blaise Doughan CLA
no flags Details | Diff
Core - Fix (18.71 KB, patch)
2010-12-02 15:43 EST, Blaise Doughan CLA
no flags Details | Diff
Core - Fix (18.26 KB, patch)
2010-12-03 10:46 EST, Blaise Doughan CLA
no flags Details | Diff
Core - Fix (to address re-open) (678 bytes, patch)
2010-12-03 14:05 EST, Blaise Doughan CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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