如何使用spring批处理staxeventitemwriter和jax2bmarshaller对子元素进行分组

时间:2018-02-07 08:52:12

标签: spring-batch

我需要生成如下所示的XML。enter code here

XML

XML

我使用StaxEventItemWriterjax2bmarshaller创建简单的XML但无法创建子元素

通过使用@XMLRootElement,可以为根元素标记

创建子元素

1 个答案:

答案 0 :(得分:0)

我们可以在staxeventitemwriter中使用headercallback和footercallback来设置静态内容。这对我有用。