Closed przno closed 10 years ago
Please post an example file somewhere.
I prepared an example here (if your browser displays a page XML Parsing Error: not well-formed..., then right click and View Page Source and save from there)
Here's the deal: that file was saved with Windows 1252 encoding, but you have specified utf-8 as the encoding. xmllint can deal with this on the command line by examining the specified encoding and comparing that with what it finds in the actual file. This linter is not comparing with the file, it's comparing with the contents of the buffer. When you open the file, you aren't noticing that Sublime Text is setting the encoding to Windows 1252. If you reopened the file with utf-8 encoding, you would see the invalid bytes converted to a "?".
It is possible to modify this linter to check the specified encoding and look for invalid bytes, but that is not something I'm going to do. In any case, it really should be your responsibility to save XML files with the same encoding you specify in the header.
I have an XML file starting with
<?xml version="1.0" encoding="UTF-8"?>
. This file has some invalid characters:(from Notepad++)
When I open it in Notepad++ (with XML Tools plugin) or lint via cmd (
xmllint myfile.xml
) I got error in both cases:However in Sublime Text I don't get any error! (Linting works, for example for missing end tag etc.)