prichardson Posted August 24, 2007 Share Posted August 24, 2007 My search function presents the results fine but when there are no results then rather than having the blank white screen, I would like to have it to say, "Sorry, there are no results.".I tried put an Choose - When & Otherwise on the property name - so if property name empty then write "Sorry, ..." otherwise display name. I thought that would work, but maybe i need to do it around the entire template? Would putting something around the entire block of code (what would i use- when & otherwise ? or something else? ) <xsl:template match="/"> <xsl:for-each select="xxx/xxx/property"> ................................................ </xsl:for-each></xsl:template> Cheers Link to comment Share on other sites More sharing options...
boen_robot Posted August 24, 2007 Share Posted August 24, 2007 I thought that would work, but maybe i need to do it around the entire template?If you need to do that, split your template in two and only apply the template when needed. For example:<xsl:template match="/"> <xsl:choose> <xsl:when test="/xxx/xxx/property"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise>Sorry, no properties. </xsl:otherwise> </xsl:choose></xsl:template><xsl:template match="/xxx/xxx/property">................................................</xsl:template> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.