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 January 2nd, 2015, 12:29 PM
Friend of Wrox
 
Join Date: Apr 2013
Posts: 101
Thanks: 14
Thanked 0 Times in 0 Posts
Default How do I add false to a empty string?

I would like to display the word false instead of an empty string "" for the
Code:
<ext:AddressReference ext:currentIndicator="">
How do I do this?

My output which is wrong
Code:
<ext:AddressReference ext:currentIndicator="true">
    <nc:LocationReference s:ref="INT10566286"/>
</ext:AddressReference>
<ext:AddressReference ext:currentIndicator="">
    <nc:LocationReference s:ref="INT4279606"/>
</ext:AddressReference>
Desired output adds the word false to the empty string
Code:
<ext:AddressReference ext:currentIndicator="true">
    <nc:LocationReference s:ref="INT10566286"/>
</ext:AddressReference>
<ext:AddressReference ext:currentIndicator="false">
    <nc:LocationReference s:ref="INT4279606"/>
</ext:AddressReference>
My xml code
Code:
<Address PartyCorrespondence="true" PartyCurrent="true" ID="10566286" Type="Standard">
    <AddressLine2>772 Minnesota AVE</AddressLine2>
    <AddressLine4>Big Lake, MN, 55309</AddressLine4>
    <Street>Minnesota</Street>
    <City>Big Lake</City>
    <State>MN</State>
    <Zip>55309</Zip>
</Address>
<Address ID="4279606" Type="Non Standard">
    <AddressLine1>8435 OAK LANE</AddressLine1>
    <AddressLine4>BECKER, MN, 55308</AddressLine4>
    <City>BECKER</City>
    <State>MN</State>
    <Zip>55308</Zip>
</Address>
My xslt code
Code:
<xsl:for-each select="Address">
    <ext:AddressReference>
        <xsl:attribute name="ext:currentIndicator"><xsl:value-of select="@PartyCurrent"/></xsl:attribute>
   <nc:LocationReference>
       <xsl:attribute name="s:ref"><xsl:text>INT</xsl:text><xsl:value-of select="@ID"/></xsl:attribute>
   </nc:LocationReference>
    </ext:AddressReference>
</xsl:for-each>





Similar Threads
Thread Thread Starter Forum Replies Last Post
empty string Vince_421 VB Databases Basics 2 October 29th, 2008 03:24 PM
isNot nothing vs. string.empty julianfraser BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 June 8th, 2008 02:00 PM
Is String.Empty spinout ASP.NET 2.0 Basics 6 July 10th, 2007 05:55 AM
SQL result returns nothing, but empty == false? barddzen Pro JSP 1 August 9th, 2004 12:52 AM
Checking for empty string richw32001 General .NET 1 August 8th, 2004 01:37 PM





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