Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339766 - Inconsistent empty element representation when using XMLStreamWriter
Summary: Inconsistent empty element representation when using XMLStreamWriter
Status: NEW
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: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-11 16:33 EST by Rick Barkhouse CLA
Modified: 2022-06-09 10:34 EDT (History)
2 users (show)

See Also:


Attachments

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