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 that describes the structure, elements, and data types an XML document must contain. In e-invoicing it is the first of two validation passes — XSD confirms the file is structurally sound before Schematron checks the business rules.

XSD catches basic errors like:

  • 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