Giter Club home page Giter Club logo

Comments (2)

tjeb avatar tjeb commented on September 2, 2024

Ok, so at the time I thought I was the only one that had a problem with introducing XSLT2 for this, but there was no other pushback so I figured I had to live with it. I ended up writing a minimal Java tool to do the translation for my other software, but I can imagine this isn't a good solution for everyone.

The short story is that the PEPPOL artefacts these are based on moved to 2 some time ago, citing rounding issues with floating point numbers, and needing xs:decimal to fix it. There were a number of workarounds already in place (like dividing and multiplying by 100) but apparently those were not enough.

TBH, I feel uncomfortable deviating from the source artefacts too much. Changing calculations also needs additional testing, for both rounding itself and compatibility with PEPPOL (though if rounding itself is tested well compatibility should be ok). We already have a number of deviations from PEPPOL in 1.1 and 1.2, but for the upcoming 2.0 (I will merge release candidate artefacts shortly) there should no longer be any, only additional checks for NLCIUS-specific rules on EN-16931.

from validation.

ojundt avatar ojundt commented on September 2, 2024

Hi @tjeb, thanks for your explanation. I understand now why working with number() and dividing/multiplying by 100 is a big pain. I just came across a SI UBL 1.1 schematron rule failing because of rounding errors in number():

Nokogiri::XML('<Foo>1.57</Foo>').xpath('number(/Foo)') => 1.5699999999999998

There are also alot of problems found on the web due to similar problems. xs:decimal is the only good fix and you should stick to it. One might only hope that the XPath2.0 support will improve in the future. In the meantime we solved it by building a small Java servlet based webservice that does the validations for us outside of our Ruby environment.

from validation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.