A warning could be emitted if there is a problem parsing or validating the document.
Here is a simple example in which a warning is emitted because of an invalid xml version:
<?xml version="dummy"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
Run it:
$ xmllint test.xml
test.xml:1: warning: Unsupported version 'dummy'
<?xml version="dummy"?>
^
<?xml version="dummy"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
The --nowarning
option only works if you also have the --htmlout
option set.
$ xmllint --nowarning --htmlout test.xml
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html><head><title>xmllint output</title></head>
<body bgcolor="#ffffff"><h1 align="center">xmllint output</h1>
<?xml version="dummy"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
</body></html>
Source code for xmllint is here.