E-Invoice XML Viewer
Operator: Abdulla Al Fahad. How tools are built and checked
An e-invoice arrives as XML, and XML is not something an approver wants to read: a UBL file for a ten-line invoice runs to several hundred lines of nested tags, while the person approving it needs the seller, the lines and the amount due. This viewer opens the file and shows it as an ordinary invoice. It reads UBL 2.1 invoices and credit notes (the syntax of Peppol BIS and one of the two syntaxes of XRechnung) and UN/CEFACT Cross Industry Invoices (the syntax of Factur-X, ZUGFeRD 2.x and the other XRechnung syntax), and it finds the XML inside a Factur-X or ZUGFeRD PDF. ZUGFeRD 1.x files use an older CII root element and are not read. A totals check re-adds the lines and VAT groups and shows any figure the file declares wrongly.
Key features
- UBL Invoice, UBL CreditNote and CII read into one invoice layout
- XML extracted from Factur-X, ZUGFeRD and XRechnung PDFs
- Line-by-line totals check against what the file declares
- Download the readable invoice as a PDF, open it for printing, or export the lines as CSV
- Source XML view with the raw document
Which formats are read, and what the totals check compares
Three root elements are recognised: Invoice and CreditNote in the UBL namespaces, and CrossIndustryInvoice in the UN/CEFACT namespace. Elements are matched by local name, so the prefix a supplier chose does not matter, and a different root such as an order or a despatch advice is rejected with the name of the element found. For UBL the viewer reads the identification and profile strings, dates, currency, buyer and order references, notes, both parties with endpoint ID and scheme, VAT and registration IDs, address and contact, payment means with account and BIC, payment terms, the VAT subtotals, the monetary totals (including allowance, charge and prepaid amounts when present) and every line with quantity and unit, price, VAT category and rate. For CII it reads the matching fields of the header agreement, delivery and settlement blocks and each included line item, and converts dates written as format 102 (YYYYMMDD) to ISO dates.
A PDF is opened for its embedded files and its associated-files array. XML attachments are ranked by name, with factur-x.xml, zugferd-invoice.xml and xrechnung.xml first, and the best match is shown; any other XML attachment is named in a note. A PDF with no XML attachment is a plain PDF invoice and has no data to show. Input limits are 10 MB for an XML file and 50 MB for a PDF, and an attachment that inflates to more than 10 MB is refused without being unpacked in full. A document that declares entities in a DOCTYPE is refused rather than parsed.
The totals check recomputes each line as quantity times unit price, the sum of lines against the declared line total, line total minus allowances plus charges against the total without VAT, each VAT group as taxable amount times rate, the groups against their lines, the VAT amounts against the VAT total, total without VAT plus VAT against the total with VAT, and the amount due as the total less prepayments. Every comparison allows half a cent. It is arithmetic only: the schematron rules that define EN 16931, Peppol and XRechnung conformity are not run.
How it works
The browser's own XML parser reads the document, and the fields are collected into one structure that both the screen layout and the PDF use. The PDF is drawn with the standard fonts, so characters outside the Western European set are replaced with plain letters or a question mark, and the page says which.
When this helps
- Reading a supplier's XRechnung before booking it in software that cannot display one
- Checking that a Factur-X PDF really contains the same figures as its visible page
- Printing an XML-only invoice for a manager who signs paper
- Spot-checking a new supplier's 14-line invoice whose declared VAT total is 0.03 away from what its VAT groups add up to
- Pulling the invoice data out of a 2 MB ZUGFeRD PDF to compare it with the purchase order line by line, using the lines CSV
Opening a file
- Drop the .xml file, or the Factur-X PDF, or paste the XML.
- Read the invoice on the right and check the Totals check panel on the left.
- Use Download PDF or Open PDF to print for the approver.
- Export the lines as CSV if you want them in a spreadsheet.
Example
A CII invoice with two lines
Network cable 2 m: 10 x 4.50 = 45.00 at 20%
Rack installation: 2.5 h x 60.00 = 150.00 at 20%
Declared: lines 195.00, VAT 39.00, total 234.00What the viewer reports
Invoice F-2026-311, issued 2026-11-05, due 2026-12-05
Seller VAT ID FR40303265045
Totals check: 9 of 9 checks matchTips for best results
- Switch the viewer's sample between UBL and CII to see how the same invoice looks from either syntax.
- A CII date shown as 2026-12-05 came from 20261205 in the file; the viewer converts only format 102 dates and passes others through unchanged.
- Open PDF to print is for a one-off look: the page uses a temporary address that is released after a minute, so download the PDF if you want to keep it.
Limits
A passing totals check does not mean the invoice is valid or legally compliant.
Attachments inside the XML itself, such as an embedded PDF in an AdditionalDocumentReference, are not extracted.
Digital signatures are neither verified nor shown.
Common errors and how to fix them
- "The XML is not well-formed"
- The file is cut off or has a stray character. Re-download it from the sender; a file saved from an email client in the wrong encoding is a common cause.
- "The root element is <...>"
- The file is some other XML document type. Only UBL Invoice, UBL CreditNote and CII CrossIndustryInvoice are read.
- "has no XML attachment"
- The PDF is an ordinary invoice without embedded data. Ask the supplier whether they can send a Factur-X or XRechnung version.
- A mismatch in the totals check
- The supplier's own numbers disagree. A one-cent difference usually means they rounded VAT per line and the file declares it per group, which is worth a query.
Frequently asked questions
Why does a Factur-X PDF open here as XML, not as the page I see?
The visible page and the XML are two separate representations in one file. The viewer shows the data layer, which is the part automated systems use.
Does it understand German XRechnung?
Yes for reading: XRechnung files are UBL or CII. The XRechnung-specific business rules are not checked.