從以下xml文件中,我想根據一個條件從biilingbatch中刪除「centrum」標籤。條件是如果是1921年,那麼我想從XML中刪除椎體標記。在xml中,在不同的Parent標籤下有許多中心標籤。我想刪除那個中心標籤whoes父標籤是billingbatch。 我的XML是:我想根據條件使用XSLT刪除xml標籤
<calculate>
<calculateAmount>
<currency>978</currency>
<individualAmount>-10000</individualAmount>
<billingType>1</billingType>
<billingPeriodEndDate>20260214</billingPeriodEndDate>
<extMvmtFinInstMode>8</extMvmtFinInstMode>
<billingbatch>
<Account>1921</Account>
<Centrum>LBNG</Centrum>
<Company>LNS</Company>
<TextCode>570</TextCode>
<TextData>952491</TextData>
</billingbatch>
<calculatebillingbatch>
<Account>1921</Account>
<Centrum>LBNG</Centrum>
<Company>LNS</Company>
<TextCode>570</TextCode>
<TextData>952491</TextData>
</calculatebillingbatch>
</calculateAmount>
預期的結果是:
<calculate>
<calculateAmount>
<currency>978</currency>
<individualAmount>-10000</individualAmount>
<billingType>1</billingType>
<billingPeriodEndDate>20260214</billingPeriodEndDate>
<extMvmtFinInstMode>8</extMvmtFinInstMode>
<billingbatch>
<Account>1921</Account>
<Company>LNS</Company>
<TextCode>570</TextCode>
<TextData>952491</TextData>
</billingbatch>
<calculatebillingbatch>
<Account>1921</Account>
<Centrum>LBNG</Centrum>
<Company>LNS</Company>
<TextCode>570</TextCode>
<TextData>952491</TextData>
</calculatebillingbatch>
</calculateAmount>
看看這個:http://www.youtube.com/watch?v=hzGG32kz9nc – 2014-10-30 07:29:05