XML validation with xmllint --stream
XML guy needed :)
I want to validate XML against a dtd.
So, xmllint comes to mind.
In a testsetup, I provoked errors by validating the "test.xml" against a wrong "xyz.dtd".
The outcome is as expected, the returncode is 3 (Validation Error)
Code:
# xmllint --valid --dtdvalid xyz.dtd --noout test.xml 2> /dev/null
# echo $?
3
However, my XMLs can get pretty big, ie >500MB
So it would be wise to use the --stream option.
But this comes back without errors:
Code:
# xmllint --valid --dtdvalid xyz.dtd --stream --noout test.xml 2> /dev/null
# echo $?
0
So my question:
Is there some structural reason, why --stream and --valid cannot work together?
Or is that a bug in xmllint?
Used libxml versions, same result:
ubuntu 9.0.4: libxml2-utils-2.6.32.dfsg-5ubuntu4.2
CentOS 5.3: libxml2-2.6.26-2.1.2.8
I think I remember it works with xsd instead of dtd.