Underlying `XMLStreamWriter` does offer a way to bind the default
namespace, at least in "repairing mode"; if so, calling:

   sw.setDefaultNamespace(defaultNsURI);

should bind the default namespace and result in namespace declaration
also being written.

But if so, you will need to manually construct the generator through
XmlFactory or XmlMapper, passing pre-constructed
XMLStreamWriter.
For XmlMapper that'd be method:

    public void writeValue(XMLStreamWriter w, Object value) throws
IOException { }

I think there is may be an issue requesting Jackson functionality to
make this easier as well so support may be
added in future.

-+ Tatu +-

On Mon, Jul 25, 2022 at 11:07 AM Norbert Kiesel <[email protected]> wrote:
>
> Is it possible to configure a default namespace for the parser? Right now I 
> add a @JacksonXmlProperty(namespace=“myns”) to every field.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "jackson-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jackson-user/6f4bce52-a30d-4692-bf7c-1b10f468a5c8n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jackson-user/CAL4a10g%3Dg%2Bsuje7mqWExKhUwTRw10O4vkhqB9BJHvzUEvkmNEQ%40mail.gmail.com.

Reply via email to