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

Bug 339766

Summary: Inconsistent empty element representation when using XMLStreamWriter
Product: z_Archived Reporter: Rick Barkhouse <rick.barkhouse>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: blaise.doughan, david.twelves
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Rick Barkhouse CLA 2011-03-11 16:33:28 EST
As can be seen in the following test case:

org.eclipse.persistence.testing.jaxb.stax.XMLStreamWriterDefaultNamespaceTestCases

This test marshals to an XMLStreamWriter (the implementation of which is parser-dependent).

When using the Woodstox parser, the document is marshalled as:

<root xmlns="someNamespace"><employee xmlns=""/></root>

Which, from an EclipseLink standpoint, is how empty elements should be marshalled.

However, in this case it would appear that using other XML parsers results in the following XML:

<root xmlns="someNamespace"><employee xmlns=""></employee></root>

This is not how EclipseLink should be marshalling an empty element.

*** This issue was discovered because a Woodstox test started failing, so an additional check was added to this test case to accept both formats.  It appears though that Woodstox was actually behaving properly, and the test case was previously coded to allow the incorrect behaviour in other parsers.  When this bug is fixed this additional check should be removed. ***
Comment 1 Rick Barkhouse CLA 2011-03-11 16:34:22 EST
See bug 339765 for more information.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:14:51 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:34:25 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink