2009-06-25 103 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