EDI to Xml smooks转换问题

时间:2014-09-29 20:49:26

标签: xslt edi smooks

尝试通过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~

... 此处字段分隔符为&#39;&lt;&#39;。上面的代码适用于除此之外的其他符号。 但是当我使用&#39;&lt;&#39;给出错误如下。

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"?>

1 个答案:

答案 0 :(得分:0)

&lt; worked for me.

Some other escape characters
"   &quot;
'   &apos;
<   &lt;
>   &gt;
&   &amp;