我使用xslt从xml文件中提取信息。
xml文件是:
<object>
<identifier>identifier</identifier>
<link>UD</link>
<title>Current Title</tite>
<impact>
<product>The product</product>
<evolution id="Evo 1">
<descr>Current description</descr>
</evolution>
</impact>
</object>我的xlst文件是:
<xsl:for-each select="//object">
<tr>
<td>
<xsl:value-of select="identifier"/>
</td>
<td>
<xsl:value-of select="link"/>
</td>
<td>
<xsl:value-of select="title"/>
</td>
<td>
<xsl:value-of select="impact[1]/product"/>
</td>
<td>
<xsl:value-of select="impact[1]/product/evolution[1]/@id"/>
</td>
<td>
<xsl:value-of select="impact[1]/product/evolution[1]/descr"/>
</td>
</tr>但是,我似乎无法得到最后两个xsl值,我一定犯了一个错误(前4列没有问题)。你能解释一下为什么吗?
发布于 2014-05-19 12:27:31
进化是一个兄弟姐妹,而不是product的孩子--它是直接影响的孩子。
<xsl:value-of select="impact[1]/evolution[1]/@id"/>
<xsl:value-of select="impact[1]/evolution[1]/descr"/>https://stackoverflow.com/questions/23737667
复制相似问题