I have recently started to take a closer look at the
EU e-invoice schematron validator and need some tip how data duplication could be avoided in this project (find some basic background in the end of the email).
In this project some schematron files are quite identical for different formats, as the rules to be tested rely on the semantic model or on common parts called code lists.
I already described the problem
in an issue, but it was closed, I fear due to the lack of knowledge how to handle it. Therefore I would like to provide an example, as I believe it should work somehow..
Let's take a look at the two code list files, being close to equal:
The files should only differ in the context being used.
It's been more than fifteen years since I used XPath/XSLT, so I was a little rusty, but I thought the 'calling' schematron file
should simply provide the context as parameters, like a module is calling a sub-module.
It did not work out, as <sch:include> does now allow any children such as parameter.
Could someone point me into a problem-solving direction, please?
Thanks in advance,
Svante
PS: Some basic background:
The EU requires from its member states to accept electronic XML invoices either based on UBL or CII (UN/CEFEACT cross-industry invoice) called
EN 16931.
The elegant trick they have been using is to define a semantic model and map it to each XML format. The first two parts of the spec are free available, the mapping is not.