XSL中判断一个节点是否为空咋办呢?
peppi 2002-09-27 02:46:41 XML:
<logo>founder.gif <!--欲判断此处是否有内容-->
<location>left</location>
<href>mailto:chenbo</href>
</logo>
XSL:
<xsl:template match="logo">
<xsl:if test="sting-length(normalize-space())>0"> <!--判断当前节点字符是
长度是否大于0-->
<a>
<xsl:attribute name="href">
<xsl:value-of select="href"/>
</xsl:attribute>
<img border="0">
<xsl:attribute name="src">
/MyWebSite/webApplication/resource/image/logo/
<xsl:value-of select="logo"/>
</xsl:attribute>
<xsl:attribute name="align">
<xsl:value-of select="location"/>
</xsl:attribute>
</img>
</a>
</xsl:if>
</xsl:template>
我想进行的操作是:我想在<LOGO>后面判断是否有内容,如果有则输出,没有就不做处理.这里是判断是否有founder.gif,有则处理.我该怎么办?