如果找到节点中的某个值,我想知道是否可以用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