itplr-kosit / validator-configuration-xrechnung

Configuration for validating documents against the German XRechnung standard using the KoSIT validation tool
https://xeinkauf.de/xrechnung/
Apache License 2.0
58 stars 15 forks source link

validation error BR-CL-24 and application/xml #40

Closed landrix closed 3 years ago

landrix commented 3 years ago

how i can validate against the XRechnung-Extension?

if i add a application/xml mime-type a validation error will be thrown

[BR-CL-24]-For Mime code in attribute use MIMEMediaType. Pfad: /ubl:Invoice/cac:AdditionalDocumentReference[5]/cac:Attachment[1]/cbc:EmbeddedDocumentBinaryObject[1]

<cac:AdditionalDocumentReference>
  <cbc:ID>attachment.xml</cbc:ID>
  <cac:Attachment>
    <cbc:EmbeddedDocumentBinaryObject mimeCode="application/xml" filename="attachment.xml">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxkYXRhPg0KPC9kYXRhPg==</cbc:EmbeddedDocumentBinaryObject>
  </cac:Attachment>
</cac:AdditionalDocumentReference>

this issue says this mime type is supported

https://4257-gitlab-ee-b2bd6-web.nws.netways.de/xrechnung/xrechnung/-/issues/59

phax commented 3 years ago

Hi, did you use the XRechnung 2.0.0 validation artefacts?

      <assert
        test=".[@mimeCode = 'application/pdf' or @mimeCode = 'image/png' or @mimeCode = 'image/jpeg' or
 @mimeCode = 'text/csv' or @mimeCode = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' or
 @mimeCode = 'application/vnd.oasis.opendocument.spreadsheet' or @mimeCode = 'application/xml']"

looks good to me

landrix commented 3 years ago

i use the latest release

https://github.com/itplr-kosit/validator-configuration-xrechnung/releases/tag/release-2020-07-31

and use it like this

validationtool-1.4.0-java8-standalone.jar -s scenarios.xml -h XRechnung-UBL-200.xml

Is not that right? I have attached an example.

XRechnung-UBL-200.zip

phax commented 3 years ago

That is beyond my knowledge of the solution. I guess @rkottmann is needed here :)

But I see your point. Since this is the "extension" to be used in the wild, we do need to learn a bit here ourselves. The ecosio validator from https://ecosio.com/en/peppol-and-xml-document-validator/ complains as well, but on the underlying EN XSLT (which I shouldn't use in that case) - so this is a task for me as well ;-)

phax commented 3 years ago

@rkottmann Where do I find the EN16931 rule set that e.g. does not contain the BR-CL-24. Or what is your take on this? Shall we just filter out certain error messages instead?

phax commented 3 years ago

@landrix This issue is not forgotten...

landrix commented 3 years ago

@phax no problem :-)

phax commented 3 years ago

So your bug has been validated and will be fixed in the internal GitLab repository.

rkottmann commented 3 years ago

The acceptance of xml as mime code is an extension of the standard xrechnung. Hence, it only works with the customization id of the extension which is urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0#conformant#urn:xoev-de:kosit:extension:xrechnung_2.0 instead of urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0

rkottmann commented 3 years ago

in case you still have issues, feel free to re-open this issue

tze commented 3 years ago

Hi,

attachments of type application/xml do not work as expected for me.

Using java -jar validationtool-1.4.0/validationtool-1.4.0-standalone.jar -s validator-configuration-xrechnung_2.0.0_2020-07-31/scenarios.xml with the attached files yields the following results.

XRechnung-UBL-2020-12-17-with-xml-attachment-and-extension-urn.xml Rejected but expected to be valid.

--------------------------------------------------------------------------------------------------------------------------------------------------------------
|filename                                                            |Schema |Schematron|Acceptance|Error/Description                                         |
| XRechnung-UBL-2020-12-17-with-xml-attachment-and-extension-urn.xml |   Y   |    N     |  REJECT  | [BR-CL-24]-For Mime code in attribute use MIMEMediaType. |
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Acceptable:  0  Rejected:  1

XRechnung-CEFACT-2020-12-17-with-xml-attachment-and-extension-urn.xml Rejected but expected to be valid.

---------------------------------------------------------------------------------------------------------------------------
|filename                                                               |Schema |Schematron|Acceptance|Error/Description   |
| XRechnung-CEFACT-2020-12-17-with-xml-attachment-and-extension-urn.xml |   N   |    Y     |  REJECT  |                    |
---------------------------------------------------------------------------------------------------------------------------
Acceptable:  0  Rejected:  1

XRechnung-CEFACT-2020-12-17-with-xml-attachment-without-extension-urn.xml Accepted but expected to be invalid.

-------------------------------------------------------------------------------------------------------------------------------
|filename                                                                   |Schema |Schematron|Acceptance|Error/Description   |
| XRechnung-CEFACT-2020-12-17-with-xml-attachment-without-extension-urn.xml |   Y   |    Y     |ACCEPTABLE|                    |
-------------------------------------------------------------------------------------------------------------------------------
Acceptable:  1  Rejected:  0

XRechnung-CEFACT-2020-12-17-with-invalid-attachment-without-extension-urn.xml Accepted but expected to be invalid.

---------------------------------------------------------------------------------------------------------------------------------------
|filename                                                                       |Schema |Schematron|Acceptance|Error/Description   |
| XRechnung-CEFACT-2020-12-17-with-invalid-attachment-without-extension-urn.xml |   Y   |    Y     |ACCEPTABLE|                    |
---------------------------------------------------------------------------------------------------------------------------------------
Acceptable:  1  Rejected:  0

Github-KoSIT-Validator-Configuration-Issue-40-XML-test-files.zip

tze commented 3 years ago

Apparently I cannot reopen this. Is anyone reading this or should I open a new issue?