Monthly Archives: August 2014

Why JavaEE ?

Why JavaEE is so popular? Not because it is the super useful, just this is implementation of all incoming business requirements for a time. This is so called template patterns for business, nothing more: not technical brilliance, not ideological concern.

Here is high availability, high scalability, high reliability platform for building business infrastructure.
The time from first release is a proof.
Use java!

Floating point operations in XPath

You may need to perform arithmetic operation with XPath-expression like sum, etc. But Saxon parser cast all floating point values to DOUBLE by default (as Java).
If you have next xml:


So, for sum you use next XPath expression:


And in result you’ll have NOT 1.555, but 1.4999999754 for example.
This is normal java behavior! Don’t panic!
Just use some trick:


And it gives you 1.555 in result.

As you see, adding /xs:decimal(.) solves the problem with data losses.