XML parse error — E1005 / E1009 well-formedness
Diagnose and fix UBL XML structure errors that cause E1005 or E1009 rejection before even reaching PINT AE validation.
E1005 and E1009 are rejected before PINT AE schematron validation runs — the file is not valid UBL 2.1 XML.
Common XML problems
| Problem | Symptom | Fix |
|---|---|---|
| Wrong root element | E1005 — root is Invoice without namespace |
Add xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" |
| Missing namespace declarations | E1009 — missing cac: or cbc: prefixes | Copy namespaces from the sample invoice |
| Non-UTF-8 characters | Parse error on special characters | Save the file as UTF-8 without BOM |
| Unclosed tags | Parse error — expected closing tag | Run the file through an XML validator (VS Code, xmllint) |
| Wrong date format | Schema error on IssueDate |
Dates must be YYYY-MM-DD (e.g. 2026-10-17) |
| Amount has too many decimals | Schema error on Amount type |
Amounts allow up to 2 decimal places |
| BOM in file header | Parse error at line 1 column 1 | Save as UTF-8 without BOM |
How to diagnose
- Download the rejected XML from the portal.
- Open it in VS Code — XML errors are highlighted immediately.
- Or run:
xmllint --noout yourfile.xml— it prints the first parse error. - Compare the root element and namespace declarations against the PINT AE sample invoice.
Minimal valid root element
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
See also: Sample invoices · XML validator.