0

试图通过 smooks 将 EDI 转换为 xml。在转换为 smooks xml 时,字段分隔符存在一些问题。

<medi:edimap xmlns:medi="http://www.milyn.org/schema/edi-message-mapping-1.4.xsd">

    <medi:description name="Invoice" version="1.0"></medi:description>

    <medi:delimiters segment="~" field="<" component="^" sub-component="~"/>

... ... EDI 文件格式如下: ...

SE<17<340001~
GE<4<34~

...这里的字段分隔符是'<'。上面的代码适用于除此之外的其他符号。但是当我使用 '<' 给出如下错误。

ERROR:[09-29-2014 04:05:07 PM]:[org.mule.exception.AbstractExceptionListener:267]:
Caught exception in Exception Strategy: Unable to filter InputStream for target profile [org.milyn.profile.Profile#default_profile].
org.milyn.SmooksException: Unable to filter InputStream for target profile [org.milyn.profile.Profile#default_profile].
        at org.milyn.delivery.dom.SmooksDOMFilter.filter(SmooksDOMFilter.java:294)
        at org.milyn.delivery.dom.SmooksDOMFilter.doFilter(SmooksDOMFilter.java:243)
        at org.milyn.delivery.dom.SmooksDOMFilter.doFilter(SmooksDOMFilter.java:216)
        at org.milyn.Smooks._filter(Smooks.java:516)
        at org.milyn.Smooks.filterSource(Smooks.java:475)......
.....
...
Caused by: org.milyn.edisax.EDIConfigurationException: Error parsing EDI Mapping Model [<?xml version="1.0" encoding="UTF-8"?>
4

1 回答 1

0
&lt; worked for me.

Some other escape characters
"   &quot;
'   &apos;
<   &lt;
>   &gt;
&   &amp;
于 2014-09-30T01:00:22.507 回答