Comment by chrismorgan

1 day ago

For reference, observe what happens if you try opening this malformed document in a browser: save it with a .xhtml extension, or serve it with MIME type application/xhtml+xml.

Firefox displays naught but the error:

  XML Parsing Error: mismatched tag. Expected: </b>.
  Location: file:///tmp/x.xhtml
  Line Number 22, Column 3:
  </p>
  --^

Chromium displays this banner on top of the document up to the error:

  This page contains the following errors:
  error on line 22 at column 5: Opening and ending tag mismatch: b line 19 and p
  Below is a rendering of the page up to the first error.

Thanks for showing these. We can see Firefox matches the same style of accurate but unhelpful error message.

Chromium is much more helpful in the error message, directing the user to both line 19 and 22. It also made the user-friendly choice to render up to the error.

In the context of XHTML, we should also keep in mind that Chrome post-dates XHTML by almost a decade.

  • If, on the other hand, you have some sorts of XSLT errors, Firefox gives you a reasonably helpful error message in the dev tools, whereas Chromium gives you a blank document and nothing else… unless you ran it in a terminal. I’m still a little surprised that I managed to discover that it was emitting XSLT errors to stdout or stderr (don’t remember which).

    Really, neither has particularly great handling of errors in anything XML. None of it is better than minimally maintained, a lot of it has simply been unmaintained for a decade or more.