redhat-developer / redhat-developer/vscode-xml

xs:alternative and xs:assert are not supported (document marked invalid)

Open
#1,092 2 comments 2 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

Steps to reproduce:

  • Write an XSD
  • Inside an element bring up completion popup and select xs:alternative
  • Tag is highlighted as error indicating that xs:alternative is not allowed which is wrong: xs:alternative can only be used inside an element

The same for xs:assert:

  • Write an XSD
  • Inside a complexType bring up completion popup and select xs:assert
  • Tag is highlighted as error indicating that xs:assert is not allowed which is wrong: xs:assert can only be used inside a complexType

In both situations the completion popup correctly proposes the tags to be inserted but the syntax checker rejects them as invalid. Furthermore XML validation/completion using such XSDs fail altogether since the XSD is incorrectly parsed.

These are though two important tags to create more complex XSDs allowing some kind of data validation/completion instead of only structure validation/completion.

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

Reproduce the problem with XSDs containing xs:alternative inside an element and xs:assert inside a complexType. Trace the completion popup, syntax checker, and XML validation/completion paths, then verify both constructs are accepted in their permitted contexts and that XSD-based validation and completion work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode, xml
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.