Open Source · In DevelopmentPersonal project

ECF XML Validator

A developer tool for validating Dominican Republic e-CF invoice XML against official DGII XSD schemas. It highlights every issue in context — breaking errors, math discrepancies, conditional warnings, and informational notes — with human-readable messages instead of the vague feedback DGII gives you.

The problem

DGII tells you something is wrong. That's usually all it tells you.

Nine times out of ten, the most you get from DGII is a field name and a generic error code — no indication of what the correct value should be, no hint at why your structure is wrong, no explanation of which conditional rule you violated. During the certification process you get slightly more context, but it's still limited and cryptic.

Developers end up debugging invoices blind: resubmitting, getting the same error, changing one field at a time, burning limited government-issued NCF sequences in the process.

What DGII says

"Campo RNCComprador invalido."

What you need to know

RNCComprador is required for all E-31 invoices. Your buyer must have a valid RNC (or cedula). The field cannot be omitted even if the buyer name is present.

Interface

What it looks like

Click any error card to jump to the highlighted XML line — and back.

ECF XML ValidatorIn development
E-31 · Factura de Crédito Fiscal · pre-firma
Highlighting

Five states, immediately readable

Breaking error

DGII will reject — missing required fields, invalid RNC, wrong field names, schema violations.

Math discrepancy

Calculated ITBIS, totals, or retentions don't match the declared amounts.

Conditional warning

Invoice passes as Aceptado Condicional — phone too long, address over character limit.

Informational

Not an error — signature absent, unusual date gap, or a deprecated field in use.

All clear

No issues found — the entire XML highlights in green.

Roadmap

Built in phases.

Shipping a useful MVP first, then expanding. No feature creep.

MVPIn development
  • Paste or upload XML — pre-signature and signed both accepted
  • Auto-beautify packed XML before displaying
  • Invoice type detection → correct XSD schema selected automatically
  • Full schema validation against official DGII XSD files
  • RNC checksum validation (catches typos without a database lookup)
  • eNCF prefix ↔ TipoeCF consistency check
  • Signature presence detection — noted if absent
  • Inline highlighting with 4 severity levels
  • Clickable error panel — human-readable messages in Spanish
v1.1Planned
  • Math validation — ITBIS calculations, totals, retention amounts
  • Date sanity checks — FechaEmision, FechaHoraFirma, future dates
v1.2Planned
  • Full conditional field logic — required-if rules by invoice type and buyer category
  • Field documentation on hover — the DGII spec for each field, inline
v2Planned
  • Signature integrity verification — validate the cryptographic signature, not just its presence
  • Batch mode — validate multiple XMLs at once
  • Exportable error report
Open source

Two things, one project.

The core validator logic will be published as a TypeScript npm package — so other developers can integrate it into their own tooling without depending on this interface. The web app is both a showcase of the package and a standalone tool anyone can use.

npm package
Core validator — importable in any TypeScript project
Coming soon
Web interface
This tool — open source on GitHub
Coming soon
GitHub — gary4gld