XML Validation & Schema (XSD/DTD)

Understand the difference between well-formed XML and schema-validated XML using XSD and DTD.

Interactive Tool: Practice in real-time with Pixlint's free browser-based XML Validator. No data is uploaded.
Open tool →

An XML document can be categorized into two stages of compliance:

  • Well-Formed XML: Conforms to basic XML syntax rules (tags closed, single root, quoted attributes).
  • Valid XML: In addition to being well-formed, conforms to an external schema definition specifying allowed tag names, ordering, and data types.

XSD (XML Schema Definition)

W3C XML Schema (XSD) is written in XML itself. It allows developers to enforce strong typing (e.g. xs:integer, xs:date), value restrictions (regex patterns, min/max lengths), and complex hierarchies.