【发布时间】:2015-07-01 08:49:36
【问题描述】:
请原谅,我不是 XSLT 方面的专家(一点也不),所以这可能真的很糟糕,但是......
我有我的 xml(例如)
<tests>
<test seq="1">
<foo name="foo1" />
<bar name="bar1" />
</test>
<test seq="2">
<foo name="foo2" />
<bar name="bar2" />
</test>
<test seq="1">
<foo name="foo3" />
<bar name="bar3" />
</test>
<tests>
我有我的 xslt(再次举例)
<xsl:template match="dptest">
<xsl:for-each select="/tests/test">
<p>
Sequence:<xsl:value-of select="@seq"/><br/>
<b>Name Of Foo:</b><xsl:value-of select="/foo/@name"/> and <b>Name Of Bar:</b><xsl:value-of select="/bar/@name"/>
</p>
</xsl:for-each>
</xsl:template>
我想吐出来......
序列:1
Foo 名称:foo1 和 名称 酒吧:bar1序列:2
Foo 的名称:foo2 和 酒吧名称:bar2序列:3
Foo名称: foo3 和 酒吧名称:bar3
但我得到...
序列:1
Foo 名称: 和 Bar 名称:序列:2
Foo 的名称: 和 Name 的 酒吧:序列:3
Foo 的名称: 和 Name 酒吧的:
如果有人能指出我正确的方向,我将不胜感激:)
干杯
达兹
【问题讨论】: