-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to integrate validation for ZUGFeRD/Factur-X XMLs #143
Comments
Here’s a concise step-by-step guide to creating a new ZUGFeRD profile scenario for the KoSIT Validator by following the structure of the XRechnung profile: 1. Understand the XRechnung ScenarioThe XRechnung profile in
You’ll replicate this logic for ZUGFeRD profiles. 2. Gather ResourcesCollect the ZUGFeRD-specific resources:
3. Define NamespacesIn the scenario, declare namespaces relevant to ZUGFeRD, such as:
4. Match Documents Using CustomizationIDUse the <match>exists(/rsm:CrossIndustryInvoice/rsm:ExchangedDocumentContext/rsm:GuidelineSpecifiedDocumentContextParameter/rsm:ID[ . = 'urn:factur-x.eu:1p0:extended'])</match> Replace 5. Add XML Schema ValidationInclude <validateWithXmlSchema>
<resource>
<name>XML Schema for ZUGFeRD</name>
<location>path/to/ZUGFeRD-schema.xsd</location>
</resource>
</validateWithXmlSchema> 6. Add Schematron ValidationReference Schematron rules for additional validations: <validateWithSchematron>
<resource>
<name>ZUGFeRD Business Rules</name>
<location>path/to/ZUGFeRD-rules.xsl</location>
</resource>
</validateWithSchematron> 7. Configure ReportingDefine how validation results are reported: <createReport>
<resource>
<name>Validation Report</name>
<location>path/to/report-template.xsl</location>
</resource>
</createReport> This approach lets you efficiently adapt the XRechnung scenario structure for ZUGFeRD profiles without extensive rework. |
Ich hatte das vor ein paar Tagen mal so ähnlich gemacht und das Ergebnis war durchaus schon zu gebrauchen. Beim Punkt 7 habe ich den bisher mitgelieferten xrechnung-report.xsl verwendet und frage mich aber ob man hier eine spezielle ZUGFeRD Variante des Reports benötigt. Gibt es irgendwo eine Dokumentation zum reporting Teil ? |
ich hab das von Peter mal zusammengefasst und nur auf das ZUGFeRD-Extended Profil beschränkt. Also alles mit XRechnung rausgeworfen. Man kann dann später dem Validator mehrere Configurationen mittels -s -r übergeben (siehe hier #142) TODO wäre noch ausmisten und weitere ZUGFeRD-Profile und Versionen ergänzen https://github.com/LandrixSoftware/validator-configuration-zugferd |
I am not a professional when it comes to XML. However, I would like to check the XMLs embedded in ZUGFeRD/Factur-X with the KoSIT Validator. Extracting the XML from the PDF is not a problem. Of the ZUGFeRD profiles, only EN16931 (Comfort) and XRechnung work out-of-the-box because the XML specification is already available in the KoSIT validator. However, I would also like to integrate the other profiles.
When I download the ZUGFeRD 2.3.2 definitions, they also contain schema files for the different profiles. But is there an understandable guide for beginners on how to incorporate these schemas into the scenarios.xml? I have already looked at the content of the scenarios.xml for the XRechnung, but I still don't know which of the ZUGFeRD XSD and XSLT I need for this (in particular whether CII needs to be validated separately). Where can I get help?
The text was updated successfully, but these errors were encountered: