redhat-developer / redhat-developer/vscode-xml

xml(cvc-complex-type.4) requires and xml(cvc-complex-type.3.2.2) forbids attribute

Open
#623 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
328
Forks
101
Avg merge
1d 17h
Merged PRs (30d)
7

Description

Hello,
I'm feeling a bit lost now. I'm seeing an issue which is, for me, apparently connected to the vscode-xml extension.

Preface:
In my project I'm creating a repository which holds different XML files and schemas to allow the validation of these files. I want to store the schemas in a seperate folder. To have the validation running in VSCode I set up a catalog.xml, which defines the position of the schema(s). The validation works as intended when I put the schema file and the XML in the same folder and reference the schema directly via xs:noNamespaceSchemaLocation. When I use the way over the catalog.xml and reference the schema via xmlns="http://schem.as/foo" I get the below described behaviour.

Issue:
I require an attribute "schemaVersion" for the root element "foo". I then get two errors within VSCode at the same time, one telling me, that the schemaVersion attribute is required, and the other telling me, that the schemaVersion attribute is not allowed.

grafik

grafik

I put together a minimal sample project which you can find here: https://github.com/trostn/xml-xsd-vscode-mess-minimal

I cleary have to say that I am not the most experienced person with XML, if this did not yet became obvious anyways.
Am I doing something wrong or is this indeed an issue with the vscode-xml extension or VSCode?

Thanks in advance!
Torsten

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked minimal sample project, catalog.xml, and the XML/XSD pair; compare validation through the catalog with direct xs:noNamespaceSchemaLocation validation. Reproduce the two simultaneous diagnostics in VSCode and trace the extension entry point that handles catalog-based schema resolution. Done means the contradictory required and forbidden-attribute diagnostics are resolved for the sample.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.