Skip to content

How to avoid wstxns1: prefix  #666

Open
@mailsanchu

Description

@mailsanchu

Given the following classes
RootNamespace.java

@JacksonXmlRootElement(namespace = "namespace1", localName = "RootNamespace")
public class RootNamespace {
    @JacksonXmlProperty(namespace = "namespace1", localName = "childNamespace")
    private ChildNamespace childNamespace;
}

ChildNameSpace.java

public class ChildNamespace {
    @JacksonXmlProperty(namespace = "namespace2", localName = "Name")
    private ThirdLevel thirdLevel;
}

ThirdLevel.java

@Setter
@Getter
public class ThirdLevel {
    @JacksonXmlProperty(namespace = "namespace2", localName = "Name")
    private String name;
}

and It is generating the following output when I convert it into string

<?xml version="1.0" encoding="UTF-8"?>
<RootNamespace xmlns="namespace1">
  <childNamespace>
    <wstxns1:Name xmlns:wstxns1="namespace2"/>
  </childNamespace>
</RootNamespace>

and I would like to generate it the following

<RootNamespace xmlns="namespace1">
    <childNamespace>
        <Name xmlns="namespace2"/>
    </childNamespace>
</RootNamespace>

Is it possible to do. Any help is greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions