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

RE: Printing Null Values with XSLT

Subject: RE: Printing Null Values with XSLT
From: "Reich, Eric" <ereich@xxxxxxxxxxxxxx>
Date: Fri, 13 Oct 2000 14:31:08 -0400
xslt null value
THANK YOU, MIKE! :-)

-----Original Message-----
From: Kay Michael [mailto:Michael.Kay@xxxxxxx]
Sent: Friday, October 13, 2000 1:06 PM
To: 'xsl-list@xxxxxxxxxxxxxxxx'
Subject: RE: Printing Null Values with XSLT



> Now, what I want to happen is to add some XSLT language that would
> be able to not print, say, a Default column if, and only if, there
> is no value associated it to it. If it does find it, then it prints
> it.

I would start by defining boolean variables, one for each column,
to determine whether the column is needed, e.g.

<xsl:variable name="include_description" 
select="boolean(item/@description[.!=''])"/>

This will be true if at least one of the <item> elements has a "description"
attribute
whose value is other than "".

Then when printing the header and other rows, test this variable:

<xsl:if test="$include_description">
  <td><xsl:value-of select="@description"/></td>
</xsl:if>

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 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.