Here's the basic commandline:
Code: Select all
$ xmllint --noout --schema $XSD_FILE $XML_FILE
To make things more interesting, I'll use a somewhat real-world example of a METS Metadata XML export - cmmon in long-term preservation context.
Let's say we have the following set of files:
- metadata_mets.xml
- mets.xsd
Code: Select all
$ xmllint --noout --schema mets.xsd metadata_mets.xml
If not, you will receive information about what/where in the XML file does not validate against the given XSD.metadata_mets.xml validates