How to check XML file with XSD via xmllint

I need to check my xml file with this XSD file. The easiest way to do this is xmllint, but I can't get it to work. Can someone tell me the exact command?

I tried:

xmllint --valid myxsd.xsd myxml.xml 

What am I doing wrong? This only outputs 2 files on the command line

edit: you need to do this in the console, because it will be necessary during the build process

+5
source share
1 answer

Having -schema this out, I had to use -schema instead of --validate .

 xmllint -schema yourxsd.xsd yourxml.xml --noout 

--noout ensures that your code in XSD and XML is not displayed. In this case, you will see only verification errors.

+23
source

Source: https://habr.com/ru/post/1265484/


All Articles