0

The configuration of my flow is:

<flow name="addVendors" doc:name="addVendors">
        <file:inbound-endpoint path="/ws/esb/vendors/input/" moveToDirectory="/ws/esb/vendors/processed/" responseTimeout="10000" doc:name="File"/>
        <file:file-to-string-transformer mimeType="text/xml" doc:name="File to String"/>
        <jdbc-ee:xml-to-maps-transformer encoding="UTF-8" mimeType="text/xml" doc:name="XML to Maps"/>
        <component class="com.myapp.integration.VendorsHelper" doc:name="Java"/>
        <file:outbound-endpoint path="/ws/esb/vendors/output" responseTimeout="10000" doc:name="File"/>
    </flow>

I'm trying to send the following xml:

<?xml version="1.0"?>
<book>
        <note id="1">
            note1
            <to>Tove</to>
            <from>Jani</from>
            <heading>Reminder</heading>
            <body>Don't forget me this weekend!</body>
            <author>Some author</author>
        </note>
        <note id="2">
            note2
            <to>Mark</to>
            <from>Smith</from>
            <heading>Invitation</heading>
            <body>Invitation for birthday!</body>
            <author>Some author</author>
        </note>
</book>

The problem is that I get two empty hashmaps after xml-to-maps transformation. What is incorrect in my code? how to debug it?

4

1 回答 1

1

正如transformer 的文档中解释的那样,transformer 转换的XMLxml-to-maps必须符合特定的模式(在文档中提供)。

下面是一个有效 XML 文档的示例:

<table>
  <record>
    <field name="id" type="java.math.BigDecimal">0</field>
    <field name="name" type="java.lang.String">hello</field>
  </record>
</table>

因此,您需要使用 XSL-T 转换器将您的 XML 转换为预期的 XML 格式,然后您才能使用转换器。

于 2013-09-17T16:25:43.580 回答