我试图设置parttext到@head如果use_head="true"
不存在的存在和到的<head>
</head>
如果use_head="true"
内容的变量foo或@foo是本XSLT设置取决于属性
<xsl:template match="toc_part">
<xsl:variable name="artnum">
<xsl:value-of select="../@num" />
</xsl:variable>
<xsl:variable name="partnum">
<xsl:value-of select="@num" />
</xsl:variable>
<xsl:variable name="parttext">
<xsl:if test="@use_head">
<xsl:value-of select="head"/>
</xsl:if>
<xsl:if test="not[@use_head]">
<xsl:value-of select="@head"/>
</xsl:if>
</xsl:variable>
<tr>
<td>
</td>
<td>
<a class="int" href="{$GBLfilePre}{$artnum}.html#{$artnum}{$partnum}"><xsl:text>Part </xsl:text><xsl:value-of select="$partnum" /></a>
</td>
<td>
<xsl:value-of select="$parttext" />
</td>
</tr>
</xsl:template>
我也试过了:
<xsl:if test="@use_head"><xsl:variable name="parttext"><xsl:value-of select="head"></xsl:variable>
<xsl:if test="not[@use_head"]><xsl:variable name="parttext"><xsl:value-of select="@head"></xsl:variable>
给出的部分文件undefined被引用时。