[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] Get the first Array element
Subject: Re: [xsl] Get the first Array element From: henry human <henry_human@xxxxxxxx> Date: Fri, 11 May 2012 13:32:50 +0100 (BST) |
Since the reuirements has been changed now, it is correct to have the otherwise statemt as bellow: xsl:otherwise>00000000000000</xsl:otherwise> </xsl:choose> >You might try and add attributes (numbers p.e. ) to the totals/amount and see which ones go where in the (unnecessarirly nested) choose. it is right what you means. Thank you! hny ----- Urspr|ngliche Message ----- Von: Michel Hendriksen <michel.hendriksen@xxxxx> An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx CC: Gesendet: 14:16 Freitag, 11.Mai 2012 Betreff: Re: [xsl] Get the first Array element I guess you mean with " If I have it in this way in the otherwise.." that you refer to your previous code. Well again, the first test fails as it tests for a <space> value, not an empty value. Then within the first otherwise it tests for the value to be positive (which also fails) and after that you try to format the not-found-Amount to something which results to NaN in the nested otherwise. You might try and add attributes (numbers p.e. ) to the totals/amount and see which ones go where in the (unnecessarirly nested) choose. Michel On Fri, May 11, 2012 at 1:24 PM, henry human <henry_human@xxxxxxxx> wrote: > If I have it in this way in the otherwise part I get for that Taxtotal which HAS NO Amount still a result > (<amount>00000000000000</amount>) > Therfore I did : > <xsl:otherwise></xsl:otherwise> > The solution works fine for me, thnak you guys! > But I think still this statement : <xsl:when test="cac:TaxTotal[child::cbc:Amount][1]/cbc:Amount > > does not query ONLY the taxtotal elemnets which HAS AN amount but the other taxtotals too? > Kind regards > hny > > ----- Urspr|ngliche Message ----- > Von: Michel Hendriksen <michel.hendriksen@xxxxx> > An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > CC: > Gesendet: 12:27 Freitag, 11.Mai 2012 > Betreff: Re: [xsl] Get the first Array element > > First test had a space it seems, so never matched > > So something like: (second part not needed I guess, test might better) > <xsl:choose> > <xsl:when test="cac:TaxTotal[child::cbc:Amount][1]/cbc:Amount >= 0"> > <xsl:value-of > select="format-number(floor(cac:TaxTotal[child::cbc:Amount][1]/cbc:Amount),'+ 0000000000000;-0000000000000') > "/> > </xsl:when> > > <xsl:when test="cac:TaxTotal[child::cbc:Amount][1]/cbc:Amount < 0"> > <xsl:value-of > select="format-number(floor(cac:TaxTotal[child::cbc:Amount][1]/cbc:Amount),'+ 0000000000000;-0000000000000') > "/> > </xsl:when> > > <xsl:otherwise>00000000000000</xsl:otherwise> > </xsl:choose> > > --~------------------------------------------------------------------ > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ > or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx> > --~-- > > --~------------------------------------------------------------------ > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ > or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx> > --~--
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Get the first Array eleme, Michel Hendriksen | Thread | [xsl] RE: A shorter way to test for, Scott Trenda |
Re: [xsl] Get the first Array eleme, Michel Hendriksen | Date | [xsl] Get to 2 max values and eleme, W Charlton |
Month |