【发布时间】:2010-11-05 06:36:39
【问题描述】:
对于给定的 XML 节点,我需要获取它的键值对。举个例子:
对于 XML:
<root>
<detail1>
<test1> Text1 </test1>
<test2> Text2 </test2>
<test3> Text3 </test3>
</detail1>
<detail2> description 1 </detail2>
<detail3> description 2 </detail3>
</root>
我需要一个如下表(忽略最上面的元素):
详细信息1 |测试1:文本1 |测试2:文本2 |测试2:文本3 | 详情2 |说明 1 | 细节3 |说明 2这对 XSLT 可行吗?如果有人能指出我的示例或资源,那将非常有用。
【问题讨论】:
-
你想要什么格式的表格,HTML?
-
是的,我需要一个 HTML 表格。
-
好问题,+1。请参阅我的答案,以获得完全符合 XSLT 精神的完整而简短的解决方案(使用推送样式)。这是迄今为止唯一能准确产生所需输出的答案。