Please excuse me, I'm no expert in XSLT (AT ALL) so this could be really really bad but...
I have my xml (for example)
<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>
and I have my xslt (again for example)
<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>
and I'm wanting to spit out...
Sequence:1
and bar1 和 bar1Sequence:2
and bar2 和 bar2Sequence:3
and bar3 和 bar3
But I'm getting ...
Sequence:1
and 和Sequence:2
and 和Sequence:3
and 和
if anyone could point me in the right direction I would appreciate it MASSIVELY :)
Cheers
Daz
don't use a full path
select="/foo/@name"
but a relative path
select="foo/@name"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.