Skip to content

CodeAction to activate xml.validation.resolveExternalEntities to true #810

Open
@angelozerr

Description

@angelozerr

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:

image

  • 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:

image

We need really improve that:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions