This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Assist With choose condition
- From: "Scott Purcell" <spurcell at vertisinc dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 17 Jul 2002 11:53:29 -0500
- Subject: [xsl] Assist With choose condition
- Reply-to: xsl-list at lists dot mulberrytech dot com
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@vertisinc.com | 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