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

Choose conditional by tag value

Subject: Choose conditional by tag value
From: "Amy Drayer" <amostrom@xxxxxxxxx>
Date: Mon, 13 Aug 2007 08:31:12 -0500
 Choose conditional by tag value
Dear XSL list:

I am new to this, and I've tried to figure out why this isn't working
using books and websites without any success.  Please share your
insight with me!

I am styling XML that is produced by third party software.  It gives a
list of events, and if there aren't any events, it gives a message in
the <title> tag that reads No Events Currently Scheduled.  I want that
to look different than days with actual events.  So:

 <xsl:template match="/">
      <xsl:when  test="[title='No Events Currently Scheduled']">
            <p>No events scheduled</p>
       <xsl:for-each select="event/item">
         <div class="xmlitem">
           <span class="xmlfeedtitle">
              <xsl:attribute name="href">
                <xsl:value-of select="link" />
             <xsl:value-of select="title"
         <p class="xmlitemdate">
           <xsl:value-of select="time"></xsl:value-of> at
           <span class="xmlfeedlocation">
             <xsl:value-of select="library"></xsl:value-of>

And I have two XML samples to work with:
No events:
<title>No Events Currently Scheduled</title>

<title>Basic PC (Personal Computers)</title>
<date>Tuesday August 7th, 2007</date>
<time>09:00 AM</time>
<description>Want to learn how to use personal computer? This free,
one-hour basic computer training class is an excellent place to start.
Gain experience using the mouse, keyboard and Microsoft Windows
operating system.</description>
<library>Corinth Library</library>

Can anyone please tell me what I am doing wrong?  I thought it was the
spaces, but it's a string... right?  Thank you for your help.

In peace,

Amy M. Drayer
Web Interface Designer

Current Thread


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.
First Name
Last Name
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.