Skip to content

Instantly share code, notes, and snippets.



Last active Jul 24, 2020
What would you like to do?
How to use xrechnung-visualization

How to use xrechnung-visualization

1. Install Ant

Install brew

/bin/bash -c "$(curl -fsSL"

Then install ant using brew

brew install ant

2. Run ant

Go into xrechnung-visualization repo and run ant (may take a few minutes)

cd xrechnung-visualization

The ant scripts will download all tools required to execute the transformations

Once download, you'll find a lot of files in the newly created /build folder.

3. Transform CIUS XRechnung to HTML or PDF

We're using SAXON, a open-source XSLT processor (saxon9he.jar) which was downloaded by the ant script. It uses the xsl style sheets in the repository to style the XML files.

You can run java -jar lib/saxon9he.jar to get more informations how it works

First we have to convert the XML first into the intermediate .xr format.

java -jar lib/saxon9he.jar -s:path/to/Rechnung.xml -xsl:src/xsl/ubl-invoice-xr.xsl -o:out/Rechnung.xr

Generate HTML

java -jar lib/saxon9he.jar -s:out/Rechnung.xr -xsl:src/xsl/xrechnung-html.xsl -o:out/Rechnung.html

Generate PDF

java -jar lib/saxon9he.jar -s:out/Rechnung.xr -xsl:src/xsl/xr-pdf.xsl -o:out/Rechnung.pdf 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment