Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 25th, 2006, 05:25 AM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 131
Thanks: 10
Thanked 0 Times in 0 Posts
Default Outputing Null values.

Hi,

Using the following code as an example, how do I output a NULL value in the 'value-of select'? Is there a NULL statement I need, or is it simply "" or " "?

Code:
<xsl:if test="string-length(.//Min)=0">
    <xsl:element name="NumericResult">
        <xsl:attribute name="UnitOfMeasure"><xsl:value-of select="$strUOM"/></xsl:attribute>
            <xsl:value-of select=""/>
    </xsl:element>                    
</xsl:if>
Thanks in advance,


Neal

A Northern Soul
__________________
Neal

A Northern Soul
 
Old July 25th, 2006, 05:40 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

There's no such thing as a null value in XSLT, you must be thinking of a different language. Do you mean a zero-length string? That's simply select="''".

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 25th, 2006, 05:46 AM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 131
Thanks: 10
Thanked 0 Times in 0 Posts
Default

Great, thanks for the help.

Neal

A Northern Soul





Similar Threads
Thread Thread Starter Forum Replies Last Post
if statements and null values chris1012 Java Basics 1 January 3rd, 2008 09:10 AM
Null values jmcgranahan BOOK: Access 2003 VBA Programmer's Reference 0 August 29th, 2006 02:25 PM
null values for properties polofson .NET Framework 2.0 1 April 23rd, 2006 05:33 AM
CheckBoxList and Null Values steve35719 ASP.NET 2.0 Basics 1 April 21st, 2006 09:42 AM
Handling Null Values nvenkat75 ADO.NET 2 January 16th, 2006 05:46 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.