|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: RE: Totals for conditional sums ?maybe?
> This statement strips all non-numeric characters (haven't made it to
> reformating back to $###,###.## yet):
>
> <xsl:value-of
> select="(translate(//AwardFullData/AwardItemizedLine/transacti
> onAmount,t
> ranslate(//AwardFullData/AwardItemizedLine/transactionAmount,'
> 0123456789
> ', ''), ''))"/>
>
> Result when applied to data: 180400
That's with a 1.0 processor (using a node-set where a string is expected
takes the string value of the first node and ignores the others). With a 2.0
processor (in 2.0 mode) this will give you an error: if you want the first
item only, you have to say so; if you want to convert all the nodes, you use
a "for" expression.
>
>
> This statement is supposed to sum transactionAmount where count of
> periodLinePeriodNumber <1
>
> <xsl:value-of select="
sum(translate(....
>
> Result when applied to data: Can not convert #STRING to a NodeList!
>
The sum() function in 1.0 expects a node-set, the translate function returns
a string, and (as the Xalan message almost says) you cannot convert a string
to a node-set.
>
> Any suggestions?
>
Use one of the several approaches given in previous responses.
Michael Kay
http://www.saxonica.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








