[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] Schematron and comma as a decimal delimiter
- From: "Michael Kay" <mike@saxonica.com>
- To: 'Juha Ikävalko' <juha.ikavalko@tieke.fi>,<xml-dev@lists.xml.org>
- Date: Mon, 4 Sep 2006 12:24:26 +0100
> The problem is that a comma has been used as a decimal
> delimiter and sum() function seems to work only with dots. I
> tested translate() function but it seems to work only with a
> single node, not with a node-set. Is there any workaround
> available for my problem?
Like so many things (despite ERH's views) this one is so much easier in
XPath 2.0:
sum(for $x in ... return number(translate($x, '.', ',')))
If you're stuck with 1.0, google for "XSLT sum computed values". The
solutions fall into four categories: (1) multi-phase transformations, (2)
higher-order functions (FXSL), (3) recursion over the items being summed,
(4) extension functions. None of these can conveniently be used in an XPath
(as distinct from XSLT) context.
Michael Kay
http://www.saxonica.com/
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]