[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: test for blank

Subject: Re: test for blank
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Wed, 20 Nov 2002 22:16:25 +0100
xsl test blank
contains() tests for substring. If you set the substring to test for to '', the test is also evaluated to true. Furthermore an "else" exists in XSLT, but not for <xsl:if>, but <xsl:choose> and <xsl:when>. You can use multiple (exclusive) <xsl:when>s and <xsl:otherwise>.

<xsl:choose>
  <xsl:when test="string(@value)">
    the value of @value is: <xsl:value-of select="@value"/>
  </xsl:when>
  <xsl:when test="not(@value)">
    <!-- no @value found -->
  </xsl:when>
  <xsl:when test="not(string(@value))">
    There is nothing to see
  </xsl:when>
</xsl:choose>

Regards,

Joerg

SAL ROSALES Jr. wrote:
I'm trying to test for a value of nothing for with
XSL. I understand there are no 'else' statements
available in xsl so I'm trying to get this to work. I
thought using the not function would work but so far
the only output I'm getting is from the 1st nested if
statement

Here are my if statements:

<xsl:if test="@value">
						<xsl:if test="@value[contains(., '')]">
							There is nothing to see
							</xsl:if>
						<xsl:if test="@value[not(contains(., ''))]">
							<xsl:value-of select="."/>
							</xsl:if>										
						</xsl:if>


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.