xmlxsdtransformationinvoiceubl

Transform UBL invoice to comply xrechnung-semantic-model.xsd


I am busy adapting my invoices to the XRechnung standard. Now I am trying to apply the public visualizer offered under https://github.com/itplr-kosit

Regarding the visualizer, under https://github.com/itplr-kosit/xrechnung-visualization?tab=readme-ov-file I get this instruction: "UBL Invoice/CreditNote XML or CII XML have to be transformed to an intermediate XML which has to be valid to a proprietary simple XML Schema" (the simple XML Schema is https://github.com/itplr-kosit/xrechnung-visualization/blob/master/src/xsd/xrechnung-semantic-model.xsd)

So now I am wondering how to do this transformation efficiently. Will I have to hack an extra stylesheet for this?

Thank U


Solution

  • The stylesheet https://github.com/itplr-kosit/xrechnung-visualization/blob/master/src/xsl/ubl-invoice-xr.xsl is supposed to do the job of transforming your UBL invoice to the intermediary format.

    It is and XSLT 2 stylesheet so you need to use an XSLT 2 processor or an XSLT 3 processor to apply the stylesheet; in the Java world Saxon (current versions are 11 and 12) is the right tool for XSLT 3 (which is backwards compatible to XSLT 2).

    In the JavaScript world and Node.js there is SaxonJS 2.

    For .NET there is XmlPrime and Saxon .NET, as well as SaxonCS for .NET Core.

    For C/C++ and Python/PHP there is SaxonC 12.