如果找到節點中的某個值,我想知道是否可以用XLST選擇一個值。我對XSLT沒有任何經驗,但我需要這個在Microsoft BizTalk中的過程。XSLT如果節點中存在值,則選擇該值
所以我想去做的例子:
<STF_11_OfficeHomeAddress>
<AD_0_StreetAddress>Street 1</AD_0_StreetAddress>
<AD_1_OtherDesignation>AD_1_OtherDesignation_0</AD_1_OtherDesignation>
<AD_2_City>City 1</AD_2_City>
<AD_3_StateOrProvince>Provence 1</AD_3_StateOrProvince>
<AD_4_ZipOrPostalCode>ZIP 1</AD_4_ZipOrPostalCode>
<AD_5_Country>Country 1</AD_5_Country>
<AD_6_AddressType>TYPE 1</AD_6_AddressType>
<AD_7_OtherGeographicDesignation>OtherGeographicDesignation 1</AD_7_OtherGeographicDesignation>
</STF_11_OfficeHomeAddress>
<STF_11_OfficeHomeAddress>
<AD_0_StreetAddress>Street 2</AD_0_StreetAddress>
<AD_1_OtherDesignation>OtherDesignation 2</AD_1_OtherDesignation>
<AD_2_City>City 2</AD_2_City>
<AD_3_StateOrProvince>Province 2</AD_3_StateOrProvince>
<AD_4_ZipOrPostalCode>Zip 2</AD_4_ZipOrPostalCode>
<AD_5_Country>Country 2</AD_5_Country>
<AD_6_AddressType>AddressType 2</AD_6_AddressType>
<AD_7_OtherGeographicDesignation>OtherGeographicDesignation 2</AD_7_OtherGeographicDesignation>
</STF_11_OfficeHomeAddress>
如果價值<AD_7_OtherGeographicDesignation>OtherGeographicDesignation 2</AD_7_OtherGeographicDesignation>
存在,選擇<AD_0_StreetAddress>Street 2</AD_0_StreetAddress>
。唯一的問題是,序列並不總是相同的,並且節點<STF_11_OfficeHomeAddress>
可以在同一個文件中出現11次。
有人可以幫我嗎?
非常感謝你! – user1292411 2012-03-26 08:07:29