以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XML基础 』  (http://bbs.xml.org.cn/list.asp?boardid=1)
----  如何判断有没有节点  (http://bbs.xml.org.cn/dispbbs.asp?boardid=1&rootid=&id=49504)


--  作者:haibo120
--  发布时间:7/6/2007 3:50:00 PM

--  如何判断有没有节点
比如
<d>
<dig>dddd</dig>
</d>
<d>
</d>
<d>
<dig>dddd</dig>
</d>
怎么判断第二个<d>中没有<dig>
--  作者:Qr
--  发布时间:7/6/2007 4:04:00 PM

--  
<xsl:template match="d">
         <xsl:choose>
           <xsl:when test="dig">有</xsl:when>
           <xsl:otherwise>无</xsl:otherwise>
         </xsl:choose>
   </xsl:template>
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
62.500ms