An invoice that asks before it claims
Every other document here reaches a standard by declaring it: the file says it is Factur-X, and it is written as Factur-X. Declaring is easy; being right is not. A document can name an invoice it never attached, claim a level of detail the XML inside it does not follow, and sit in a container the standard does not allow — and go out saying all three, to come back refused by the accounting department it was sent to.
So this one asks first. The library reads the document as it stands, writes nothing, changes nothing, and hands back everything it knows to stand between that document and the standard named — all of it at once, each finding citing the clause it comes from and the file it is about. Not the first fault and a stop: the list, so one round of work settles it.
The invoice here is composed the way somebody first writes it, and what comes back is printed. Two things stand in the way: it claims no archival standard, and it names factur-x.xml while carrying no file under that name. Put those right and one is left — it claims the EN 16931 level of detail where the XML follows Basic — because a file that is not there is a file nothing can read. Put that right and nothing stands, and the PDF is written. Nothing is written while anything stands.
An empty report is not a certificate. It says that nothing this library knows to look for is in the way, which is not the same as conforming: veraPDF, a free program with no hand in writing the file, is what says that. What the report does settle is the document contradicting itself, which is the one fault nobody further down can put right. The same three rounds run from Rust and from Python.
What this example shows
- Every finding at once, each naming the clause it comes from and the file it is about.
- Two in the way as first composed, one once the file is carried and the archival standard claimed, none once the level of detail claimed is the one the XML follows.
- The document measured before a byte of it goes out, and refused rather than written while anything stands.
The source code, complete
Nothing is left out and nothing is simplified: this is the program exactly as it runs, for whoever writes your software.
Read the Rust source
Read the Python source
The document itself
Open the document in English
Open the document in French