Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
angelozerr opened this issue Nov 17, 2022 · 0 comments
Open
Labels
bug Something isn't working codeaction DTD

Comments

@angelozerr
Copy link
Contributor

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working codeaction DTD
Projects
None yet
Development

No branches or pull requests

1 participant