-
-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unbound namespace URI '' when using isAttribute=true on JacksonXmlProperty #311
Comments
Interesting. You are right, there is an exception, and unexpected one at that. |
Also interesting: fails on 2.x, but passes on 3.0.0-SNAPSHOT for some reason. Hmmh. |
Oh, actually... so, exception is weird, but one thing to note is that you MUST NOT turn off namespace repairing. Jackson XML module absolutely expects and requires it be enabled; I'll probably add a check so that attempting to use one without will fail when constructing I also wonder if you might be misunderstanding how XML namespaces, and in particular default namespace works with attributes: it is different from elements. That is, "default namespace" only ever applies to elements, and never to attributes: attribute without prefix always has namespace of "". To have attribute in a different namespace requires use of namespace bound to explicit prefix. |
Filed #326 as replacement. |
When streaming beans and producing XML I get an exception saying Unbound namespace URI '' when I am using @JacksonXmlProperty(isAttribute=true).
Using Jackson 2.9.7 with woodstox 5.0.3.
If I set
xmlOutputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true);
The code works but then the produced document has no xmlns.
A gist displaying the failing code
The text was updated successfully, but these errors were encountered: