Klarfile

KF-XML-DOCTYPE: The XML declares a DTD, and we refuse it

This code shows up when an electronic invoice is validated. Here is what it means, why it fires, and what to change in the file.

Why this code appears

The attached file contains a <!DOCTYPE> declaration. We read no DTD coming from a third party: entities that call one another can blow up the browser's memory, and an external entity asks the reader to go and fetch a file elsewhere. No legitimate Factur-X invoice carries one.

How to fix it

Produce the XML without a document type declaration. If your tool adds one, it is a serialisation setting, not a requirement of the format.

Where it happens

This check is ours, not a code from the standard: we do not cover enough of EN 16931 to borrow its numbers, and a misattributed official code would send you to fix the wrong field. It concerns XML.

Check my invoice All rejection codes