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

Re: choose/otherwise not doing anything?

Subject: Re: choose/otherwise not doing anything?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 15 Oct 2002 20:25:42 +0100
xml when test
Hi Richard,

> I'm sure I'm doing something really stupid, but I cant figure out
> for the life of me why the following template always outputs and
> empty element.

Yeah, you're doing something really stupid -- you've just missed some
quotes :) You're doing:

  <xsl:value-of select='positive'/>

when you mean to do:

  <xsl:value-of select="'positive'"/>

though personally, I'd just use literal text rather than an
<xsl:value-of> instruction:
  
<xsl:template match="medical_assessment/tb_test_positive |
                     medical_assessment/hiv_test_positive">
  <xsl:copy>
    <xsl:choose>
      <xsl:when test=". = 'true' or . = '1'">positive</xsl:when>
      <xsl:when test=". = 'false' or . = '0'">negative</xsl:when>
      <xsl:otherwise>otherwise</xsl:otherwise>
    </xsl:choose>
  </xsl:copy>
</xsl:template>

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.