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

When test expression

Subject: When test expression
From: "Paul Dupuy, Jr." <PDupuy@xxxxxxxxxxx>
Date: Tue, 27 Mar 2001 20:04:09 -0800
test expression
I have a template with logic:

   <SPAN>
      <xsl:choose>
         <xsl:when test="A/B">
            <xsl:value-of select="A/B"/>
         </xsl:when>
         <xsl:otherwise>
            <xsl:node-name/>
         </xsl:otherwise>
      </xsl:choose>
   </SPAN>

to process a document like:

   <Apple>
      <A>
         <B>Red</B>
      </A>
   </Apple>
   <Kiwi>
      <A>
      </A>
   </Kiwi>
   <Orange>
      <A>
         <B></B>
      </A>
   </Orange>

which produces:

   <SPAN>Red</SPAN>
   <SPAN>Kiwi</SPAN>
   <SPAN></SPAN>


I'd like to have the test for A/B only succeed when the
value of the B node is not "" (producing <SPAN>Orange</SPAN>
in the example).

I've tried

   <xsl:when test="A/B[not(.)]"/>

but this does not work. Any suggestions?


Thanks for your time,

Paul	

 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-2011 All Rights Reserved.