The Manual of Jackson XML write Object like this
<Simple>
<x>1</x>
<y>2</y>
</Simple>
in https://github.com/FasterXML/jackson-dataformat-xml but in my code,it has [xmlns="" ],and it can't be in my business.
My code:
public class Sample {
private int id=1;
private String name="abc";
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public static void main(String[] args) throws Exception {
XmlMapper mapper = new XmlMapper();
System.out.println(mapper.writeValueAsString(new Sample()));
//<Sample xmlns=""><id>1</id><name>abc</name></Sample>
}
}