簡單映射範例
下面是一個將數據直接從輸入映射至輸出內的數據的範例。變換僅改變文檔中字段的結構和名稱。
TML
<?xml version='1.0'?> <transformation> <map> <target>SSC/Payload/AddressBook/Address/Name</target> <source>generated-by-outlook/contact/name</source> </map> <map> <target>SSC/Payload/AddressBook/Address/TelNum</target> <source>generated-by-outlook/contact/phone</source> </map> </transformation>
輸入數據
<generated-by-outlook> <contact> <name>R Giggs</name> <phone>0171 295 541</phone> </contact> <contact> <name>A Ferguson</name> <phone>0181 55 6732</phone> </contact> </generated-by-outlook>
生成的輸出
<SSC> <Payload> <AddressBook> <Address> <Name>R Giggs</Name> <TelNum>0171 295 541</TelNum> </Address> <Address> <Name>A Ferguson</Name> <TelNum>0181 55 6732</TelNum> </Address> </AddressBook> </Payload> </SSC>