Comments (2)
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.
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)
- PaymentMeansTypeCode HOT 4
- BR-*-05 BR-*-06 BR-*-07 BR-*-09 fail on negative zero HOT 3
- NLCIUS validations are not done when whitespaces are used in CustomizationID
- Code BR-GA-0 is not in error text in si-ubl-2.0-ext-gaccount.sch HOT 1
- Consider creating a check on //cac:PaymentMeans/cac:PayeeFinancialAccount/cbc:ID HOT 1
- Bug in BR-NL-10 test [SI-UBL-2.0-NLCIUS] HOT 2
- Bug in BR-NL-11 test [SI-UBL-2.0-NLCIUS] HOT 3
- Typo in comment [SI-UBL-2.0-NLCIUS]
- Check for [BR-NL-7] is not done with string HOT 2
- Wrong element checked for TypeCode of CreditNote
- Make 'contains' of CustomizationID in si-ubl-2.0-nlcius.sch HOT 5
- Why is NL:VAT (9944) not allowed in BR-NL-10? HOT 11
- cbc:PaymentMeansCode is checked against digit and not a string
- Minor errors in XSLT conversion bat script
- Problem with SI-UBL 1.2 validation rules - attribute context HOT 5
- Let's just deprecate SI-1.2. It's the only Peppol BIS V2 based (Invoice) format left on the earth. HOT 4
- Question on November 2023 release HOT 2
- Suggestion: include preprocessed Schematron file
- Peppol BIS V3 NL-R-008 cross-border HOT 4
- PartyId validation like PEPPOL-COMMON-R041 for OINO and KVK
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from validation.