如何判断组件内容是否为空?

如:

1<a>123</a>
1<a>345&gt;</a>

如何分辨出第三种情况?
---------------------------------------------------------------

IN xsl:

1<xsl:if test="a=''">no content</xsl:if>

Or

1<xsl:if test="a[.='']">no content</xsl:if>

in javascript
t=xmldom.selectSingleNode("//a[index()=2]")
if(t.text=="") alert("no content")

Published At
Categories with Web编程
Tagged with
comments powered by Disqus