我从url:http://www.concert.ru/mail-ru/concert.xml获得xml,我需要标记、ActionPlaces和操作以单独的方式处理,所以我为它们使用了两个不同的标记:
<xsl:template match="/">
<xsl:apply-templates select="Data/ActionPlaces"/>
<xsl:apply-templates select="Data/Actions"/>
</xsl:template>但是它们应该被包裹在标签里,叫做enfinity,所以当我喜欢这样的时候:
<enfinity>
<xsl:template match="Data/Actions">..
<xsl:template match="Data/ActionPlaces"> ..
</enfinity>我得到了错误的输出。当主标签在一个模板中时--我得到了正确的输出--但是需要主标签作为顶部。怎么处理?
发布于 2014-08-13 17:05:50
尝试:
<xsl:template match="/">
<enfinity>
<xsl:apply-templates select="Data/ActionPlaces"/>
<xsl:apply-templates select="Data/Actions"/>
</enfinity>
</xsl:template>https://stackoverflow.com/questions/25291743
复制相似问题