Skip to content

Support for custom prefix for namespace #207

Open
@jlous

Description

@jlous

This code:

    public class Ingredients {
        public final String eggs="12";
        @JacksonXmlProperty(namespace = "urn:produce:fruit")
        public final String bananas="6";
        ...
    }

produces this xml when serialised:

  <Ingredients>
    <eggs xmlns="">1</eggs>
    <wstxns1:bananas xmlns:wstxns1="urn:produce:fruit">
      6
    </wstxns1:bananas>
  </Ingredients>

This works, but I'm missing a way to specify the namespace prefix to use, so I could get

  <Ingredients>
    <eggs xmlns="">1</eggs>
    <fruit:bananas xmlns:fruit="urn:produce:fruit">
      6
    </wstxns1:bananas>
  </Ingredients>

An additional argument to @JacksonXmlProperty would be the obvious way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    adding-declarationsIssues related to adding non-content declarations to XML outputmost-wantedTag to indicate that there is heavy user +1'ing action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions