我有一个XML响应,如下所示
<Movies xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="T_MOVIELIST0" totalMovies="2">
<Movie>
<DetailLevel0 xsi:nil="true"/>
<ExternalID>EN1skynetBSKY2014102807462817</ExternalID>
</Movie>
<Movie>
<DetailLevel0 xsi:nil="true"/>
<ExternalID>FR6skynetBSKY8607347700000000</ExternalID>
</Movie>
</Movies>
我的JAXB2Marshaller对象工厂是:
/**
* Create an instance of {@link JAXBElement }{@code <}{@link TMOVIELIST }{@code >}}
*
*/
@XmlElementDecl(namespace = "", name = "Movies0", scope = ResponseGetDetail.class)
public JAXBElement<TMovieList0> createResponseGetDetailMovies0(TMovieList0 value) {
return new JAXBElement<TMovieList0>(_ResponseMovies_QNAME0, TMovieList0.class, ResponseGetDetail.class, value);
}
由于这些“xmlns:xsi和xsi:type”标签,我们面临一些性能问题。
我们的要求是响应应该如下
<Response>
<Movies totalMovies="2">
<Movie>
<DetailLevel0/>
<ExternalID>EN1skynetBSKY2014102807462817</ExternalID>
</Movie>
<Movie>
<DetailLevel0/>
<ExternalID>FR6skynetBSKY8607347700000000</ExternalID>
</Movie>
</Movies>
</Response>
请让我知道我们如何做到这一点..