A simple Python application with both GUI and CLI modes to:
- Apply an XSLT transformation to an XML invoice (Rechnung).
- Validate the transformed XML using the KoSIT Validator Java application.
- Python 3.8+
- Java 8+ (to run the KoSIT Validator JAR)
- pip (Python package installer) or pipx
Optional for GUI:
- A system with GUI support (on Linux, ensure an X server is available).
It's recommended to use a Python virtual environment to avoid system permissions issues:
-
Create a virtual environment in the project root:
python3 -m venv venv
-
Activate the environment:
-
On Linux/macOS:
source venv/bin/activate -
On Windows (PowerShell):
.\venv\Scripts\Activate.ps1
-
-
Upgrade pip (inside the venv):
pip install --upgrade pip
-
Install Python dependencies:
pip install -r requirements.txt
-
Create a directory to hold the KoSIT Validator:
mkdir -p ~/validator && cd ~/validator
-
Download & unzip the distribution:
curl -L \ "https://github.com/itplr-kosit/validator/releases/download/v1.5.0/validator-1.5.0-distribution.zip" \ --output validator.zip unzip validator.zip -
Copy your
scenarios.xmlfrom this repo into~/validator.
With the virtual environment activated, simply run:
python app.py-
In the window, Browse to select:
- XSLT file (
*.xslor*.xslt) - Input XML invoice file (
*.xml) validationtool-1.5.0-standalone.jarscenarios.xml- Validator repository directory (
resources/folder) - (Optional) Output directory (defaults to
reports/)
- XSLT file (
-
Click Run.
-
A dialog shows success or validation errors.
-
Reports (HTML + XML) are saved in the output directory.
Still with the venv activated, run:
python app.py \
path/to/transform.xsl \
path/to/input.xml \
--validator-jar ~/validator/validationtool-1.5.0-standalone.jar \
--scenarios ~/validator/scenarios.xml \
--repository ~/validator/resources \
--output-dir ./reportsExample:
python app.py \
default_fusion_UNCEFACT_CII.xsl \
502715.xml \
--validator-jar ~/validator/validationtool-1.5.0-standalone.jar \
--scenarios ~/validator/scenarios.xml \
--repository ~/validator/resources \
--output-dir ./reports├── app.py # Main application (GUI + CLI)
├── requirements.txt # Python dependencies
├── README.md # This file
├── venv/ # Virtual environment (ignored by git)
└── ...
For issues or contributions, please open a GitHub issue or pull request.