I wonder what version of xml utils you are using.
arturcz@szczaw:/tmp/stack$ xmllint --schema myschema.xsd myinput.xml; echo $?
<?xml version="1.0"?>
<myinput><header>mytestvalue</header></myinput>
myinput.xml:1: element myinput: Schemas validity error : Element 'myinput': Element content is not allowed, because the type definition is simple.
myinput.xml fails to validate
3
The 3 is result of echo $?. It works for me for following versions:
- libxml2-utils 2.9.1+dfsg1-3 (on Debian unstable) xmllint: using libxml version 20901
- libxml2-utils 2.7.8.dfsg-2+squeeze8 (on Debian squeeze) xmllint: using libxml version 20708
Please forgive me if it's obvious to you, but you need to remember that you shall not run any command between xmllint call and echo $?. So, try the exact call I put above - both commands in one line separated with semicolon. In that way you can verify if it's really problem with the xmllint.
If above sugestion won't help you, please provide output of xmllint --version and the shell you are using.