diff --git a/bears/xml/XMLBear.py b/bears/xml/XMLBear.py index ba27622d5e..ead97057f7 100644 --- a/bears/xml/XMLBear.py +++ b/bears/xml/XMLBear.py @@ -1,3 +1,5 @@ +import itertools + from coalib.bearlib.abstractions.Lint import Lint from coalib.bears.LocalBear import LocalBear from coalib.misc.Shell import escape_path_argument @@ -24,11 +26,18 @@ class XMLBear(LocalBear, Lint): gives_corrected = True def process_output(self, output, filename, file): - if self.stdout_output: # only yield Result if stdout is not empty - return self._process_corrected(self.stdout_output, filename, file) - if self.stderr_output: # pragma: no cover + if self.stderr_output: + self.use_stderr = True + if self.stdout_output: + return itertools.chain( + self._process_issues(self.stderr_output, filename), + self._process_corrected( + self.stdout_output, filename, file)) + return self._process_issues(self.stderr_output, filename) + elif self.stdout_output: return self._process_issues(self.stderr_output, filename) + def run(self, filename, file, xml_schema: path="", xml_dtd: path_or_url=""): diff --git a/tests/xml/test_files/xsd-error.xml b/tests/xml/test_files/xsd-error.xml index d0f07df6fd..7d376e561b 100644 --- a/tests/xml/test_files/xsd-error.xml +++ b/tests/xml/test_files/xsd-error.xml @@ -1,4 +1,3 @@ -