Updated Oct 19, 2026

Utilities

Check XML documents and optional XSD validity

xmllint-check is an XML well-formedness and optional local-XSD validation node.

Agent

overview

What xmllint-check does

Check XML files for well-formedness, and optionally validate them against an XSD schema, with libxml2 xmllint. Returns one JSON line per file with native error messages. No network access and no entity expansion.

Recursively check XML files with Debian libxml2-utils 2.9.14+dfsg-1.3~deb12u6. Return path-ordered JSON Lines containing file, native exit_code, well_formed and up to 200 native error lines. Supplying schema adds valid for validation against the local XSD.

Accept 1 to 200 .xml files, at most 50 MiB and 2000 entries. The optional .xsd path must stay inside the supplied folder. Malformed or invalid XML is result data; an unparsable schema, invalid schema path or unexpected native failure fails without output. --nonet prevents network fetching; external DTDs are not loaded and entities are not expanded.

Packaged version: 2.9.14. Upstream license: MIT.

source github.com/GNOME/libxml2/tree/7846b0a677f8d3ce72486125fa281e92ac9970e8

use cases

Where xmllint-check fits

Separate syntax and schema errors

Distinguish well-formedness from optional XSD validity in each row.

Validate a folder of documents

Apply one supplied local schema to every discovered XML file.

Keep native error messages

Receive bounded xmllint messages with each source path.

reference

xmllint-check inputs and flags

2 inputs
NameTypeFlagDescription
sourceFOLDER--sourceFolder with 1–200 .xml files (searched recursively) and an optional .xsd schema; maximum 50 MiB.
schemaSTRING--schemaOptional path of an .xsd file inside the source folder to validate every document against.

Showing key inputs. xmllint-check exposes 2 inputs in total.

example

Run xmllint-check

xmllint-check · command
python3 /app/run.py --source ./source --schema order.xsd ./output

guidance

Choosing xmllint-check

Use xmllint-check to distinguish malformed XML from a schema-invalid document. It exposes no DTD validation, XInclude, XPath or reformatting. XSD validation does not support entity references and can report a native internal validation error for documents using them. This is an XML job; AJV validates JSON Schema.

faq

xmllint-check questions

source: Folder with 1–200 .xml files (searched recursively) and an optional .xsd schema; maximum 50 MiB. schema: Optional path of an .xsd file inside the source folder to validate every document against.

Recursively check XML files with Debian libxml2-utils 2.9.14+dfsg-1.3~deb12u6. Return path-ordered JSON Lines containing file, native exit_code, well_formed and up to 200 native error lines. Supplying schema adds valid for validation against the local XSD.

Accept 1 to 200 .xml files, at most 50 MiB and 2000 entries. The optional .xsd path must stay inside the supplied folder. Malformed or invalid XML is result data; an unparsable schema, invalid schema path or unexpected native failure fails without output. --nonet prevents network fetching; external DTDs are not loaded and entities are not expanded.

Use xmllint-check to distinguish malformed XML from a schema-invalid document. It exposes no DTD validation, XInclude, XPath or reformatting. XSD validation does not support entity references and can report a native internal validation error for documents using them. This is an XML job; AJV validates JSON Schema.

The public image repository gives immutable image and ORAS download commands, the expected source/notices bundle checksum and pinned upstream source directions. The accompanying OCI bundle retains the original build recipe, runtime sources and full installed notices. The Git recipe keeps primary notices and an exact layer/hash index; it does not duplicate the full installed notice tree or mirror every upstream source archive. Image, source and license notice downloads.

Run xmllint-check yourself

The saved XSD fixture verifier confirmed good.xml valid, invalid.xml well formed but schema-invalid, and broken.xml malformed with an opening/ending-tag mismatch. The complete native JSON Lines report was not retained. The command shows the container entrypoint with example paths.

Facts on this page come from the live Trickest tool library.