Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358297 - XmlAnyElement produces duplicate namespace declarations when marshalling
Summary: XmlAnyElement produces duplicate namespace declarations when marshalling
Status: CLOSED INVALID
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: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-20 15:50 EDT by Rick Barkhouse CLA
Modified: 2022-06-09 10:07 EDT (History)
0 users

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-09-20 15:50:13 EDT
Consider the following Java class / XML Bindings file:

=====

@XmlRootElement
public class CustomerAnno {
    @XmlAnyElement
    public Object anyElem;
}

=====

	<java-types>
		<java-type name="Customer">
			<xml-root-element />
			<java-attributes>
				<xml-any-element java-attribute="anyElem" />				
			</java-attributes>
		</java-type>
	</java-types>

=====

If a namespace-qualified Element is set on anyElem:

anyElem = doc.createElementNS("any-element", "my-elem");

Annotations:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customerAnno xmlns="http://www.example.org/package">
    <my-elem:my-elem xmlns:my-elem="any-element" xmlns="any-element"/>
</customerAnno>

   * Note duplicate declaration of 'any-element'

XML Bindings:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:customer xmlns:ns0="http://www.example.org/package">
   <my-elem xmlns="any-element"/>
</ns0:customer>

   * Note that this is not textually identical to the Annotations version
Comment 1 Eclipse Webmaster CLA 2022-06-09 10:04:23 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:07:28 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink