卡住位具有以下並會喜歡一些想法/指針在正確的方向。我有以下XML:取計數(XSLT 1)
<RecordsCollection>
<CustomerRecord>
<customerId>12345</customerId>
<currency>USD</currency>
</CustomerRecord>
<CustomerRecord>
<customerId>12345</customerId>
<currency>USD</currency>
</CustomerRecord>
<CustomerRecord>
<customerId>90210</customerId>
<currency>USD</currency>
</CustomerRecord>
</RecordsCollection>
我需要做到的是簡單地生產含有包含了獨有的賬號,獨一無二的貨幣元素的個數單個值。爲了進一步解釋,上面的示例包含兩個具有相同貨幣(USD)的相同帳號(12345)的條目,因此它們被計爲1,另一個條目也被計爲1.因此,上面的示例應該爲在:
<totalCount>2</totalCount>
任何想法如何實現它?我知道如何選擇不同的賬戶號碼,但是我似乎無法將我的頭腦包裹起來,那就是如何計算每個賬戶中不同的貨幣。
最後,這必須使用XSLT 1.0完成了...任何想法將不勝感激!
問得好(+1)。看到我的答案是一個有效和簡短的解決方案。 :) – 2010-09-08 19:56:45