How to test if a node is empty with XSL?

Hi guys

How can I test to see if a node is empty? and if it isn’t, display something…

i’ve tried this below, without much luck!


<xsl:if test!="contains(SUMMARY,' ')">
	  <h3>SUMMARY</h3>
	  <TEXTAREA name="summary"><xsl:copy-of select="SUMMARY"/></TEXTAREA>
</xsl:if>

Many thanks for any ideas

Chewie here tells me you’re lookin’ for passage to the Alderaan system?
Why, yes I am. Yes I am!
Here’s my advise, use the code. Use the code…luke!

Example XML file:

<site>
<log>.....(with or without text in the middle).....</log>
</site>

If you want to test if its empty and then display something either way do use the following in your XSL file.

<xsl:choose>
	<xsl:when test="site/log =''">	
	<h3>Empty I tell you!</h3>
	</xsl:when>
		<xsl:otherwise>
	<p>Here I am, read me: <xsl:value-of select="site/log"/></p>
		</xsl:otherwise>
</xsl:choose>

On <xsl:when test=“site/log =‘’”> the last couple of characters are ’ ’ " (of course not spread out like that)