On 2023-05-02 13:50, Per Jessen wrote:
Carlos E. R. wrote:
On 2023-05-02 13:07, Per Jessen wrote:
Carlos E. R. wrote:
On 2023-05-02 08:22, Per Jessen wrote:
Carlos E. R. wrote:
On 2023-05-01 15:30, Per Jessen wrote: > > xmllint your.xml.file
It just prints my file back.
Good. That means it found no problem in that file.
What does it do when there is a problem?
If you had introduced an error and tried it, you would have had an answer in seconds :-)
The answer is - it complains.
I mean, is it obvious to see? Don't I have to go up a kilometre of print to see it up there, out of sight?
Again, if you had tried it, you would have had an answer in seconds :-)
Yeah, I produced an error and saw it, after posting.
I would expect to see just a message like "good" or "bad", a single line.
Well. Other people might expect a return code indicating failure or success. By default, xmllint prints the parsed tree. Add argument '--noout' if you don't want that.
Ah, thanks.
With all that print, I can not put it in my CLI:
Telcontar:/etc/firewalld # firewall-cmd --check-config && firewall-offline-cmd --check-config && firewall-cmd --reload && tail -n 100 /var/log/firewalld | grep `date -u +"%Y-%m-%d-%H"` success WARNING: 'NoneType' object has no attribute 'check': None WARNING: 'NoneType' object has no attribute 'check': None success Telcontar:/etc/firewalld #
The above has got nothing to do with xmllint, but it sounds like it checks against an xml schema and finds an unwanted/undefined attribute. Hmm, maybe not - there is no schema specified in that file.
The thing is, as it does not say what line is bad, I can not find it. Telcontar:/etc/firewalld # grep -ri NoneType * Telcontar:/etc/firewalld #
Telcontar:/etc/firewalld # grep -ri check * SuSEfirewall2-to-firewalld.txt:INFO: The dry-run has been completed. Please check the above output to ensure SuSEfirewall2-to-firewalld.txt:INFO: The dry-run has been completed. Please check the above output to ensure susefirewall2-to-firewalld_11.txt:INFO: The dry-run has been completed. Please check the above output to ensure Telcontar:/etc/firewalld #
# xmllint zones/external.xml
just prints the file and I can't know where is the line that produces that warning.
xmllint in the basic invocation only checks for the XML being well-formed, i.e. syntactically correct.
I guessed. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)