Closed RobinTNO closed 4 years ago
EDIT: when I originally opened the issue, the description was not shown, so this question is moot
For whitespace flexibility or to allow for specialization? Technically, 'contains' could result in wrong customizationid values to be accepted; but perhaps something could be done with normalize-space.
Problem now is the schematron does not work for invoices with urn:cen.eu:en16931:2017#compliant#urn:fdc:nen.nl:nlcius:v1.0#compliant#urn:fdc:setu.nl:invoice:v2.2
.
@tjeb this request is about the question "when to validate the NLCIUS rules?"
Currently, you've implemented this by looking at the complete CustomizationID
and check if it matches urn:cen.eu:en16931:2017#compliant#urn:fdc:nen.nl:nlcius:v1.0
. In other words the NLCIUS rules only apply when you have a EN16931 invoice according to NLCIUS spec. No more, no less.
However, we could easily support other use cases where communities (like SETU) reuse the NLCIUS rule set, by checking if the CustomizationID contains urn:fdc:nen.nl:nlcius:v1.0
(the part of the id that indicates use of NLCIUS).
As you can see by the CustomizationID, to indicate that SETU has added some usage specifications (hence ciUS) that are compliant with the EN and NLCIUS, the part #compliant#urn:fdc:setu.nl:invoice:v2.2
is added. However, reusing the NLCIUS ruleset does not work anymore, because it doesn't match the exact id.
As @RobinTNO suggests, you can we can use the contains()
function for this.
Or perhaps starts-with(), to make it less error-prone; however, I'm currently thinking that the CustomizationID check shouldn't be in the included file at all, but in the file that does the including (si-ubl-2.0.sch, which, interestingly enough, does have a check that uses contains).
doh, my bad, this is only about the context specification, not the customizationid rule itself. Will update soon.
The construction below does not work for the SETU Invoice.
<let name="is_SI-UBL-2.0" value="$customizationID = 'urn:cen.eu:en16931:2017#compliant#urn:fdc:nen.nl:nlcius:v1.0'" /> <let name="is_SI-UBL-2.0-ext-gaccount" value="$customizationID = 'urn:cen.eu:en16931:2017#compliant#urn:fdc:nen.nl:nlcius:v1.0#conformant#urn:fdc:nen.nl:gaccount:v1.0'" />
Therefore, please change it into the following:
<let name="is_SI-UBL-2.0" value="contains($customizationID, '#compliant#urn:fdc:nen.nl:nlcius:v1.0')" /> <let name="is_SI-UBL-2.0-ext-gaccount" value="contains($customizationID, '#conformant#urn:fdc:nen.nl:gaccount:v1.0')" />