我有一个 CSV to Java 配置文件,并且在其中一个字段中有一个 & 符号。当我转换为 Java bean 时,它会添加&
到该字段中。
如何防止 smooks 这样做?
这是配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.1.xsd" xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.1.xsd">
<params>
<param name="stream.filter.type">SAX</param>
<param name="default.serialization.on">false</param>
<param name="feature-off">http://apache.org/xml/features/scanner/notify-char-refs</param>
</params>
<csv:reader
fields="Property,PropertyID,Unit#,FloorPlan, ReportingStatus, WorkType, Sub-Status, Subject, CurrentStep, Status, DenyCounter, RevisionCounter, MoveOutDate, BaselineOPSCommitPlan, PlannedOPSCommitPlan, ActualOPSCommitPlan, BaselineCSAcceptsPlan, PlannedCSAcceptsPlan, ActualCSAcceptsPlan, BaselineOPSCommitUnit, PlannedOPSCommitUnit, ActualOPSCommitUnit, BaselineCSAcceptsUnit, PlannedCSAcceptsUnit, ActualCSAcceptsUnit, BaselineCSTurnsUnit, PlannedCSTurnsUnit, ActualCSTurnsUnit, BaselineCommunityManagerAccepts, PlannedCommunityManagerAccepts, ActualCommunityManagerAccepts, BaselineRentReady, PlannedRentReady, ActualRentReady, Area, PreleaseMove-inDate"
skipLines="1" separator=","/>
<jb:bindings beanId="UpDownUnitList" class="java.util.ArrayList" createOnElement="csv-set">
<jb:wiring beanIdRef="UpDownUnit" />
</jb:bindings>
<jb:bindings beanId="UpDownUnit" class="com.mycompany.beans.UpDownUnit" createOnElement="csv-record">
<jb:value data="csv-record/Property" property="property" />
<jb:value data="csv-record/PropertyID" property="propertyNumber" />
<jb:value data="csv-record/Unit#" property="unitName" />
...
...
...
<jb:value data="csv-record/Area" property="area" />
<jb:value data="csv-record/PreleaseMove-inDate" decoder="com.mycompany.smooks.decoders.DateNullDecoder" property="preleaseMoveInDate">
<jb:decodeParam name="format">MM.dd.yyyy</jb:decodeParam>
</jb:value>
</jb:bindings>
</smooks-resource-list>