[XSL-LIST Mailing List Archive Home]
RE: [xsl] Decimal precision
Subject: RE: [xsl] Decimal precision|
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 4 Feb 2005 23:32:03 -0000
x/y/xs:decimal() works only in Saxon 8.2. In earlier releases you have to
write it as
for $x in x/y return xs:decimal($x)
> -----Original Message-----
> From: Jim Neff [mailto:jneff@xxxxxxxxxxxxxxx]
> Sent: 04 February 2005 14:09
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] Decimal precision
> Thank you very much for your explanation.
> I hope I'm not being a pain, but I'm still not getting this right.
> I've tried your answer for doing it "by hand" and here is
> what Saxon gives
> Warning: at xsl:value-of on line 13 of
> Required item type of second operand of '/' is node();
> supplied value has
> item type
> xs:decimal. The expression can succeed only if the supplied
> value is an
> empty sequence.
> Here is line 13 from my stylesheet :
> select="sum(claim/claim_line/reimbursement_amount/xs:decimal(.))" />
> Am I missing something here or is this just not possible
> without Schemas?
> Thanks again for your tremendous assistance.
> --Jim Neff
> > -----Original Message-----
> > You either need to validate against a schema, or you need to
> > convert to a decimal "by hand":
> > sum(claim/claim_line/reimbursement_amount/xs:decimal(.))
> > Michael Kay
> > http://www.saxonica.com/