Spring 4 O/X 在其抽象背后支持多个 XML 解组器。我们使用 JAXB2。
Spring 可以根据模式验证传入的 XML 吗?我在官方文档和描述配置的 spring-oxm模式中都没有找到任何内容。这是我目前的配置,很标准。
<bean id="jaxb2Marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="marshallerProperties">
<map>
<!-- properties here -->
</map>
</property>
<property name="classesToBeBound">
<list>
<value>com.example.Message1</value>
<value>com.example.Message2</value>
</list>
</property>
</bean>