2009-06-25 102 views

回答

3

可以测试元素的存在,这种方式:

<xsl:if test="/root/parent/node"> 
    Prints if and only if the expression exists 
</xsl:if> 

如果你知道的元素存在,你只后它是否有一个值或没有的时候,用这个:

<xsl:if test="string-length(/root/parent/node) &gt; 0"> 
    Prints if the expression has a non-empty value 
</xsl:if> 
+0

干杯队友,非常感谢! – toomanyairmiles 2009-06-25 12:48:01