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

Re: xsl: Actual output is "" : Expected output is 0

Subject: Re: xsl: Actual output is "" : Expected output is 0
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Wed, 20 Aug 2008 10:15:25 +0100
Re:  xsl: Actual output is "" : Expected output is 0
2008/8/20 Sathasivam, Elayaraja <elayaraja.sathasivam@xxxxxxxxxxxxx>:
> XSLT: Version 1.0
>
> Requriement: Converting xml to xml files.
>
> XSL file:
>
> <xsl:attribute name="nb-discount">
>        <xsl:variable name="d" select="Charge[@Id='99']/@Amount -
> Charge[@Id='125']/@Amount"/>
>        <xsl:if test="$d">
>                <xsl:value-of select="$d"/> <!-- Output is
> nb-discount="" why the output is not 0 as expected-->
>        </xsl:if>
> </xsl:attribute>
>
> XML file:
>
> 1) <Charge Id="99" Amount="12.60" CurrCode="EUR" Type="9" PT="P"/>
>   <Charge Id="125" Amount="12.60" CurrCode="EUR" Type="5" PT="P"/>
>   Actual Output: nb-discount=""
>   Expected Output: nb-discount="0"
>
> 2) <Charge Id="99" Amount="12.60" CurrCode="EUR" Type="9" PT="P"/>
>   <Charge Id="125" Amount="14.60" CurrCode="EUR" Type="5" PT="P"/>
>   Actual Output: nb-discount="-2"
>   Expected Output: nb-discount="-2"
>


You problem probably lies elsewhere, post back with small complete
runnable examples (if creating them doesn't show you where the problem
is)


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.