DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Simple XSL When Statement

  • submit to reddit
        Checks to see if 'Stuff' has returned any data. If not then displays 'No data available'. If 'Stuff' has returned data then moves onto otherwise. Use  <xsl:when test="stuff = !'' "> to swap the when around.

 <xsl:when test="stuff = '' ">
  <div>No data available</div>
  <div><xsl:value-of select="stuff_alternative"/></div>