[XML-DEV Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: Formulas in XML values
- From: COUTHURES Alain <alain.couthures@agencexml.com>
- To: Michael Kay <mike@saxonica.com>, 'Kurt Cagle' <kurt.cagle@g...>, xml-dev@l...
- Date: Fri, 26 Jun 2009 09:48:01 +0200

Michael,
5CB9F5B20B44430ABA3C3433159847A5@Sealion"
type="cite">
In fact, I'm more concerned with validation than evaluation.
...
Wouldn't it be great if "1/3 + 2/3" was exactly like "1" ? As
Then you seem to be very concerned with evaluation. There are languages that
perform rational arithmetic which would make this expression return the
integer 1, but XPath is certainly not one of them, and as far as I know
Javascript isn't either.
You're right saying that there can't be validation without evaluation.
For version 1, use of rational numbers would be "at-your-own-risks" and
Javascript eval() function is enough for perfect results with +, - and
* operators and decimal numbers. The result will always be a decimal
number. Evaluation version 1 is already available with Javascript.
For version 2, rational numbers could be added. I have found Jasymca
(http://webuser.hs-furtwangen.de/~dersch/jasymca2/index.html), written
in Java for PDAs and it seems pretty fast and light :
rat(3/5)+rat(1/3) gives 14/15 as answer !
I wouldn't say that XPath can't perform rational arithmetic but rather
that rational arithmetic is not yet implemented for XPath. Benefits for
scientists, financials,... Integrating this with XForms will permit
users to set fields in web applications without a calculator always at
hand.
For version 1 and version 2, validation has to start with evaluation
which wasn't required before. So, validation has to be modified. The
same for XPath which has to evaluate node content before using it.
Does it still sound like an impossible feature ?
Best regards,
Alain Couthures
<agenceXML>
http://www.agencexml.com
|

[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
|
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
RSS 2.0 |
 |
Atom 0.3 |
 |
|
Stylus Studio has published XML-DEV in RSS and ATOM formats,
enabling users to easily subcribe to the list from their preferred news reader application.
|
Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website.
they were not included by the author in the initial post. To view the content without the Sponsor Links please
click here.
|
|