redhat-developer / redhat-developer/vscode-xml
"Element type must be declared" errors when cannot find DTD
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 328
- Forks
- 101
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 7
Description
If my XML document defines a DTD but it cannot be resolved, all of the elements in my document are shown as "Element type must be declared", which means other errors like basic structure problems are hard to identify.
This happens in every mode of xml.validation.schema.enabled - never, always, and onValidSchema. I would expect it to only happen in "always" mode, if at all.
If I don't have a DOCTYPE definition at all, the elements are not flagged.
Example DOCTYPE:
<!DOCTYPE map PUBLIC "-//IBM//DTD DITA IBM Map//EN" "ibm-map.dtd">
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the example DOCTYPE and an unresolved DTD, then compare validation behavior in the never, always, and onValidSchema modes. Trace the XML validation entry point and existing validation tests; done means unresolved DTDs no longer produce misleading element declarations outside the intended mode while genuine structure errors remain visible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100