Hello,
i am using jackson-dataformat-xml 2.9.3 with woodstox.
My goal i to write namespace prefixes, like this:
<parent xmlns:dc="http://some-url">
<dc:child>value</dc:child>
<parent>
So the key part is to have a namespace like:
xmlns:dc and to use it on child tags/attributes:
<dc:child>Is this possible with jackson?
If not, can this be acheived with overriding some woodstox functionality?
Adding namespace is easy enough: use `@JacksonXmlProperty` annotation, specifically with `namespace` property set to URI.
There is no way to directly suggest prefix to use; one generated automatically will be used ("wstxns1" etc I think by default).
Since prefixes have no semantics, this should not matter for processors; processing only considers namespace URIs, not prefixes.
If you care deeply about mappings, yes, Woodstox does have means to suggest bindings to use: either for basename ("wstxns"),
or, for suggesting specific prefix for namespace URI. For latter I don't remember if this is via factory or does it require actual
XMLStreamWriter.
-+ Tatu +-