LinuxCommandLibrary

xml-validate

Validate XML against schemas

TLDR

Validate against embedded DTD
$ xml val [file.xml]
copy
Validate against an XSD schema
$ xml val --xsd [schema.xsd] [file.xml]
copy
Validate against a RelaxNG schema
$ xml val --relaxng [schema.rng] [file.xml]
copy
Check well-formedness only (no schema validation)
$ xml val --well-formed [file.xml]
copy
Validate multiple files
$ xml val [file1.xml] [file2.xml]
copy
Validate using embedded schema reference
$ xml val -E [file.xml]
copy

SYNOPSIS

xml val [options] file...

DESCRIPTION

xml val (or `xml validate`) validates XML documents against schemas. Part of the XMLStarlet toolkit. Supports DTD, XML Schema (XSD), and RelaxNG validation. Returns exit code 0 if valid, non-zero otherwise.

PARAMETERS

--xsd file

Validate against XML Schema.
--dtd file
Validate against DTD.
--relaxng file
Validate against RelaxNG schema.
--well-formed
Check well-formedness only.
-E, --embed
Use embedded schema.
-e, --err
Print errors.

SEE ALSO

Copied to clipboard