<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:variable name="value" select="/xml/value"/>
<xsl:variable name="low" select="substring-before(/xml/normalRange, '-')"/>
<xsl:variable name="high" select="substring-after(/xml/normalRange, '-')"/>
<xsl:choose>
<xsl:when test="$value < $low">
<output>below</output>
</xsl:when>
<xsl:when test="$value > $high">
<output>above</output>
</xsl:when>
<xsl:otherwise>
<output>within</output>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
请注意,元素名称“xml”由XML 1.0 standard保留,因此避免它可能是个好主意。
你是在电子表格单元格内还是在VBA内完成这项工作?在任何一种情况下,只需检查值 MaxValue。 –
2011-05-31 03:18:41
不,这是原始的.xml和.xls文件。 (没有电子表格或VBA。) – MikeN 2011-05-31 03:26:29