【发布时间】:2017-02-09 23:15:15
【问题描述】:
我想使用 xslt 1.0 从我的输入 xml 获得以下输出。你能建议一种方法吗?
Input xml:
<result>
<item0>
<Name>Customer1</Name>
<location>1360190</location>
</item0>
<item1>
<Name>Customer2</Name>
<location>1360190</location>
</item1>
</result>
Output xml:
<result>
<item>
<Name>Customer1</Name>
<location>1360190</location>
</item>
<item>
<Name>Customer2</Name>
<location>1360190</location>
</item>
</result>
【问题讨论】:
-
使用身份转换模板example,按原样复制所有节点。并添加另一个匹配
/result/*的模板,即result的子元素,并根据需要对其进行转换。