I'm looking for a command line tool to validate an XML file with an XSD-1.1 file.
I have downloaded and installed libxerces2-java
and then tried to apply Free and open source XSD 1.1 validation tool? and Xerces validator in command line, but I couldn't get either of them to work.
So, my simple question is:
Where can I get/how can I create an XSD-1.1 validating tool that can be run from the command line to validate an XML file?
Please provide a full solution, because Java class paths and so on are a topic of their own...
Finally I found an answer to my own question:
I found the blog post "Free and open source XSD 1.1 validation tool?"
which contains a link to the file xsd11-validator.jar (Mirror 1, Mirror 2).
You can call it like this:
To run it, you can use the following command line:
And to simplify its usage, I wrote the following bash script
xsd.sh
:It can easily validate XSD-1.1 files with the following command: