上一主题: SQL 接口部分

下一主题: TranslationTableCollection 部分

InputFormatCollection 部分

本部分指定了从数据源检索的数据的结构 - 数据行将如何被切成字段,字段类型和格式是什么。 在该部分中,可以分别使用 InputFormatSwitch 与复合字段来执行初始数据筛选和数据操作。

本部分的常规工作流如下所示:

InputFormatCollection 节点可能包含一个或多个 InputFormat 节点。

XML 结构:

<InputFormatCollection>
	<InputFormat InputFormatName="MyInputFormat">
	<InputFormatFields> 
		<InputFormatField Name="sid_id" Type="string"/>
		<InputFormatField Name="content" Type="string"/>
		<InputFormatField Name="date" Type="time" 
               TimeFormat="%d/%m/%Y %H:%M:%S"/>
		<InputFormatField Name="server" Type="string" 
               Source="compound">
		<Compound>
			<Segment SourceField="content" 
                     RegularExpression=".*Job server: ([^\n]+).*" />
		</Compound>
		</InputFormatField>
	</InputFormatFields>
<TranslatorSwitch DefaultTranslator="GeoTranslator">
	<TranslatorCase  TranslatorName="NonGeoTranslator" Break="yes">
		<Condition SourceField="routing_info" Operator="EQ"
             Value="cnano"/>
	</TranslatorCase>
</TranslatorSwitch>
</InputFormat>
</InputFormatCollection>