映射元素参数
将来自源的数据映射至目标。在映射过程中,可通过应用一个函数来更改输入数据。
<map> <target/> <!-- generated output path --!> <source/> <!-- full path into input data --> <map>
参数
target
指定完全符合要求的目标路径,该目标路径将在输出数据内生成。此参数是强制的。
source
将完全符合要求的源路径指定到输入数据内。可指定一个以上的源,在这种情况下,这些源将按照其显示次序写到输出中。
范例 1
在此范例中,单一源字段直接写至单一输出字段内。
<!--Map the purchase order description to the sales order description.--> <map> <target>SSTSInput/Payload/SalesOrder/Sol_Descr</target> <source>SSTSOutput/Payload/PurchaseOrder/Pol_Descr</source> </map>
范例 2
在本范例中,多个源字段映射至单个目标字段。源指定了三个日期字段,而目标仅需要一个字段。
<!--Map the year, month and day from the input to the date field in the output. Since no function is provided, the source fields are written in the order they appear, creating the output MMDDYY. --> <map> <target>SSTSInput/Payload/SalesOrder/Date</target> <source>SSTSOutput/Payload/PurchaseOrder/Date/Month</source> <source>SSTSOutput/Payload/PurchaseOrder/Date/Day</source> <source>SSTSOutput/Payload/PurchaseOrder/Date/Year</source> </map>
范例 3
<!--Generates a target date using a user-provided function.--> <map> <target>SSTSInput/Payload/SalesOrder/Date</target> <source name='month'>SSTSOutput/Payload/PurchaseOrder/Date/Month</source> <source name='day'>SSTSOutput/Payload/PurchaseOrder/Date/Day</source> <source name='year'>SSTSOutput/Payload/PurchaseOrder/Date/Year</source> </map>