373.4. Spring 或 Blueprint DSL 的基本用法
在 & lt;dataFormats
> 块中,只需要使用唯一 ID 配置 xmljson
元素:
<dataFormats> <xmljson id="xmljson"/> <xmljson id="xmljsonWithOptions" forceTopLevelObject="true" trimSpaces="true" rootName="newRoot" skipNamespaces="true" removeNamespacePrefixes="true" expandableProperties="d e"/> </dataFormats>
<dataFormats>
<xmljson id="xmljson"/>
<xmljson id="xmljsonWithOptions" forceTopLevelObject="true" trimSpaces="true" rootName="newRoot" skipNamespaces="true"
removeNamespacePrefixes="true" expandableProperties="d e"/>
</dataFormats>
然后,您只需引用 < marshal /> 和 <
unmarshal />
DSLs 中的数据格式对象:
为此组件启用 XML DSL 自动完成比较简单:只是根据您使用的 Spring 或 Blueprint DSL 来指代适当的 Schema 位置。请记住,这种数据格式可从 Camel 2.10 开始获得,因此只有该版本中的模式才会包含这些新的 XML 元素和属性。
使用 Blueprint 的语法与 Spring DSL 的语法相同。只需确保使用了正确的命名空间和 schemaLocation。