<xsl:if   test="child::*">  
      <!--   表示有子节点   -->  
  </xsl:if>  
  <xsl:if   test="parent::*">  
      <!--   表示有父节点   -->  
  </xsl:if>  
  <xsl:if   test="following::*">  
      <!--表示后面还有节点-->  
  </xsl:if>  
  <xsl:if   test="preceding::*">  
      <!--表示前面还有节点-->  
  </xsl:if>

参考:http://www.w3school.com.cn/xpath/xpath_axes.asp

相关文章: