I am having a class in which I am getting list of objects. I am using XmlSeeAlso annotation to include the classes which are present in the list. Here is my class:
@XmlRootElement
@XmlSeeAlso({BookStore.class,Book.class,Hello.class})
public class ResponseList {
private List<Object> list;
public List<Object> getList() {
return list;
}
public void setList(List<Object> list) {
this.list = list;
}
}
I am getting following response:
<responseList>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="book">
<author>Author</author>
<name>The Book</name>
</list>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="bookStore">
<name>The Book Store</name>
<location>US</location>
</list>
</responseList>
I don't want this xmls:xsi=... in the response. I want my output to look like this:
<responseList>
<list>
<author>Author</author>
<name>The Book</name>
</list>
<list>
<name>The Book Store</name>
<location>US</location>
</list>
</responseList>
Is there any way to achieve this ?