EDI到Xml的smooks转换问题
问题描述:
试图通过smooks将EDI-to-xml转换。同时转换到smooks xml的字段分隔符有一些问题。EDI到Xml的smooks转换问题
<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"?>
答
< worked for me.
Some other escape characters
" "
' '
< <
> >
& &
这似乎是一个危险的分隔符使用,考虑到所涉及的应用程序的XML特性。另外,你会不会遇到与段和子组件是相同的分隔符的麻烦? – Andrew 2014-09-29 20:53:56
对smooks一无所知,但在XMl文档中,您必须将' 2014-09-29 20:58:23