创建 XSL 以将 XML 转换为 Excel。其中一部分是在另一个工作表上执行查找的公式。但是,我想转换/翻译返回,所以我认为 xsl:choose 是最好的。
但我不知道如何在 xsl:choose 中引用我的 ss:Formula?
<Cell ss:StyleID="RARs17"
ss:Formula="=INDEX('{$vhostname}'!R2C6:R{$vuln_count+7}C6,MATCH(RC3,'{$vhostname}'!R2C14:R{$vuln_count+7}C14,0))>
<Data ss:Type="String">
<xsl:choose>
<xsl:when test="ss:Formula = 'NF'">Completed</xsl:when>
<xsl:when test="ss:Formula = 'NR'">NR</xsl:when>
<xsl:when test="ss:Formula = 'O'">Ongoing</xsl:when>
<xsl:when test="ss:Formula = 'NA'">NA</xsl:when>
<xsl:otherwise><xsl:value-of select="ss:Formula" /></xsl:otherwise>
</xsl:choose></Data>
</Cell> <!-- Status, looks up Result -->