Reference / Compliance

Validation Mechanism

The engine uses SaxonC-HE 12.x (Native C/C++ engine) to execute industrial-grade EN 16931 Schematron rules.

Why Schematron?

Standard XML Schema (XSD) only validates structure. Schematron validates business logic:

Math Integrity

Does Net + Tax = Gross? Are line items calculated correctly?

Conditional Rules

If VAT category is 'E' (Exempt), is the reason text provided?

The "Iso-Prod" Proof

Factur-X Engine uses the official `.xsl` compiled rules from **FNFE (France)** and **KoSIT (Germany)**. When you validate an invoice with the engine, you get the **exact same result** as if you submitted it to Chorus Pro or the German public portals.

Performance Benchmark

A full EN 16931 validation (CII) takes approx 180ms on a standard container. Compare this to Java-based libraries which often require 1.5s - 3s due to JVM startup and class loading.

Error Reporting

The API `/v1/validate` returns a structured JSON report.

{
  "valid": false,
  "profile_detected": "EN16931",
  "errors": [
    {
      "rule_id": "BR-CO-13",
      "message": "The sum of Invoice line net amounts must equal the Invoice total net amount",
      "path": "//*[local-name()='SpecifiedTradeSettlementHeaderMonetarySummation']",
      "severity": "CRITICAL"
    }
  ],
  "engine": "SaxonC-HE 12.1"
}