| Summary: | Default namespace not used for @XmlNs(prefix="", namespaceURI="urn:foo") | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Blaise Doughan <blaise.doughan> | ||||||||||||||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||||||
| Severity: | normal | ||||||||||||||||||
| Priority: | P2 | CC: | david.twelves, rick.barkhouse, skrap | ||||||||||||||||
| Version: | unspecified | ||||||||||||||||||
| Target Milestone: | --- | ||||||||||||||||||
| Hardware: | PC | ||||||||||||||||||
| OS: | Windows XP | ||||||||||||||||||
| URL: | http://blog.bdoughan.com/2011/11/jaxb-and-namespace-prefixes.html?showComment=1322840794931#c2137192234870679088 | ||||||||||||||||||
| Whiteboard: | |||||||||||||||||||
| Attachments: |
|
||||||||||||||||||
Created attachment 213120 [details]
Patch - Code changes (2.3)
Created attachment 213194 [details]
Patch - new test case
Created attachment 213897 [details]
Patch - test case
Created attachment 214813 [details]
MOXy - Test Cases
Created attachment 214814 [details]
MOXy - Fix
Created attachment 214817 [details]
MOXy - Test Cases (2.3.3)
Created attachment 214818 [details]
MOXy - Fix (2.3.3)
Fix checked into 2.3.3 at rev: 11246 Fix checked into trunk at rev: 11247 Code reviewed by: Rick Barkhouse Fix Details - AnnotationsProcessor: Now declaring a prefix for the target namespace does not eliminate the possibility of having a default namespace. - NamespaceInfo: When creating a NamespaceResolver for the descriptor copy in the default namespace. I think this but has re-emerged in 2.6.3.
I tried to marshal a simple example using the package-info.java file from the description of this bug report (with the commented line uncommented).
The output contained attributes with a "ns0" prefix, instead of a without a prefix.
Like this:
xmlns:ns0="http://www.example.com/FOO"
Instead of like this:
xmlns="http://www.example.com/FOO"
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
When an @XmlNs annotation is provided with prefix="", MOXy should use the default namespace for this, but is not currently doing so. Example: @XmlSchema( elementFormDefault=XmlNsForm.QUALIFIED, namespace="http://www.example.com/FOO", xmlns={ //@XmlNs(prefix="", namespaceURI="http://www.example.com/FOO"), @XmlNs(prefix="bar", namespaceURI="http://www.example.com/BAR") } ) package blog.prefix; import javax.xml.bind.annotation.XmlNs; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlSchema;