Open
Description
By default xml.validation.resolveExternalEntities
is set to false for security issue. It is nice but it can be hard for user to know why XML validation / completion based on DTD doesn't work when xml.validation.resolveExternalEntities
is set to false.
I encountered the problem and I though it was a bug from LemMinx, but after debugging LemMinx I noticed that it was just a problem with xml.validation.resolveExternalEntities
which should be set to true.
Here my usecase.
- my
xml.validation.resolveExternalEntities
was set to false. - I open vscode
- I created a SVG file like this:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="5cm" height="4cm" version="1.1"
xmlns="http://www.w3.org/2000/svg">
</svg>
- LemMinx download the DTD and after that I see those error:
- at this step, I had the impression that LemMinx was bugged, but the fix is to set
xml.validation.resolveExternalEntities
to true - but even if you swith this setting to true, you have again the error. You have validation error and completion based on DTD doesn't work.
- you need to close vscode and reopen it. And now validation and completion based on DTD is working:
We need really improve that:
- provide a code action which set
xml.validation.resolveExternalEntities
to true - the validation and completion based on DTD should work when this setting is set to true (it is a matter of cache that it should be evicted). See Warn about the need to restart vscode when changing the value of
xml.validation.resolveExternalEntities
eclipse-lemminx/lemminx#1123