X

XSD

XML Schema Definition — the structural validation layer for e-invoice XML files, checked before Schematron business rules.

An XSD (XML Schema Definition) is a W3C standard for describing the structure, content, and data types of an XML document. In e-invoicing, XSD validation is the first of two validation passes — it verifies that the XML is well-formed and structurally correct before Schematron checks are applied for business rule compliance.

XSD validation catches errors such as:

  • Missing mandatory elements
  • Elements in the wrong order or namespace
  • Wrong data types (e.g. a date field containing free text)
  • Invalid cardinality (e.g. two <ID> elements where only one is allowed)

Key facts

  • Standard: W3C XML Schema 1.0 / 1.1
  • File extension: .xsd
  • Used in: UBL 2.1 (OASIS publishes official XSDs), UN/CEFACT CII, XRechnung
  • Validation order: XSD first → Schematron second
  • Tools: Saxon, Xerces, libxml2, xmllint --schema