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

Assist With choose condition

Subject: Assist With choose condition
From: "Scott Purcell" <spurcell@xxxxxxxxxxxxx>
Date: Wed, 17 Jul 2002 11:53:29 -0500
xsl if value of
Hello,
I am developing a xsl stylesheet. I need to check a condition and deal with it. Below is a snippet where I am building an img src tag. The problem is that the value in "contents" is sometimes empty. So I need to (on the commented out line) check if contents has a string in it. If it does, great, else I need to put in some default.jpg or something like that.

I have tried a couple of approaches, but with no luck.

This block is what I am trying to deal with. I don't know how to code if the block has data?
If someone could assist, I would be grateful.
Thanks,
Scott

<!-- test block to replace commented out line. -->
<xsl:choose>
   <xsl:if value-of select=''>
	default.jpg
   </xsl:if value-of select='hasdata'>
	<xsl:value-of select="contents" />
   </xsl:if>
</xsl:choose>




    <img height="100" width="100">
      <xsl:attribute name="src">
        <xsl:if test="type[.='system']">
            <xsl:value-of select="$systemimage" />
        </xsl:if>
        <xsl:if test="type[.='user']">
            <xsl:value-of select="$userimage" />
        </xsl:if>
        <xsl:if test="type[.='both']">
            <xsl:value-of select="$systemimage" />
        </xsl:if>
<!--       <xsl:value-of select="contents" /> -->
    </xsl:attribute>

    <xsl:attribute name="name">
        <xsl:value-of select="item_count" />
    </xsl:attribute>

    </img></center><br />




Scott Purcell | Developer | VERTIS | 555 Washington Ave. 4th Floor | St. Louis, MO 63101 |
T 314.588.0720 | F 314.588.0735 | spurcell@xxxxxxxxxxxxx | http://www.vertisinc.com

Vertis is a global powerhouse for integrated marketing and advertising solutions that seamlessly combine advertising, direct marketing, media, imaging and progressive technology. Vertis' products and services include: consumer and media research, media planning and placement, creative services, digital media production, targetable insert programs, fully integrated direct marketing programs, circulation-building newspaper products and eMarketing.




 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.