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

RE: xsl:if

Subject: RE: xsl:if
From: "Bhaskar, Rajan" <RBhaskar@xxxxxxx>
Date: Mon, 17 Jan 2005 17:08:49 -0500
RE:  xsl:if
Joris,
Thanks a lot.
worked great.


-----Original Message-----
From: Joris Gillis [mailto:roac@xxxxxxxxxx]
Sent: Monday, January 17, 2005 5:07 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  xsl:if


Tempore 22:44:52, die 01/17/2005 AD, hinc in
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Bhaskar, Rajan <RBhaskar@xxxxxxx>:

>  If the attribute value from the input xml is optional. how do i write
> my xsl:if so that if the value is present get the value else default to
> "unknown"

full syntax:
<xsl:choose>
	<xsl:when test="@value">
		<xsl:value-of select="@value"/>
	</xsl:when>
	<xsl:otherwise>
		<xsl:text>unknown</xsl:text>
	</xsl:otherwise>
</xsl:choose>

shortcut:
<xsl:value-of select="@value"/><xsl:if test="not(@value)">unknown</xsl:if>


regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
"Et ipsa scientia potestas est"  - Francis Bacon , Meditationes sacrae

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.