【发布时间】:2010-05-07 19:48:23
【问题描述】:
我需要转换一段 XML,以便我指定的列表中每个节点的值都设置为“0”
例如:
<contract>
<customerName>foo</customerName>
<contractID />
<customerID>912</customerID>
<countryCode/>
<cityCode>7823</cityCode>
</contract>
会变成
<contract>
<customerName>foo</customerName>
<contractID>0</contractID>
<customerID>912</customerID>
<countryCode>0</contractID>
<cityCode>7823</cityCode>
</contract>
如何使用 XSLT 实现这一点? 我尝试了一些我发现的示例,但没有一个按预期工作
谢谢
【问题讨论】:
-
好问题 (+1)。请参阅我的答案以获得完整的解决方案。 :)