XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] Schematron and comma as a decimal delimiter

> 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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS