Subject: bug#46764: Extra ">" sails right past XML validator

From: Mattias Engdegård <[email-masked]>
Date: Fri, 26 Feb 2021 11:28:23 +0100

26 feb. 2021 kl. 10.30 skrev Lars Ingebrigtsen <[email-masked]>:

>> ">" is not a special character at top level in XML; <M>></M> is well-formed.
>> 
>> I agree that it is an easy mistake to make and overlook. Perhaps an
>> optional warning would be helpful?
> 
> Well, if it is valid (and it is), then I don't really see how adding an
> optional warning here would be all that helpful, either -- it seems
> kinda beyond the remit of the validator here to teach XML syntax?

It's useful to prevent mistakes, not just following the standard to the letter. Given that the XML file is in an Emacs buffer there is a fair chance that it was hand-written, and then the extra ">" is likely to be unintended, especially since it can be somewhat hard to spot by a human.

Many other modes do similar things. For example, emacs-lisp-mode warns about useless backslashes in strings even though there is no actual syntax error. Think of it as a useful compiler warning.

> So I'm closing this bug report.

That's fine. Dan can reopen if he thinks nxml-mode really needs improvement.