redhat-developer / redhat-developer/vscode-xml

`import` ignored, when importing second XSD into the same namespace

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

I have this document and an XSD (linked from it from schemaLocation).

Now, the XSD imports 2 other XSDs with the same targetNamespace:

  <xs:import namespace="http://dia.gov.cz/ns/spolecne-casti-elektronickych-dokumentu/osoby" schemaLocation="https://ofn.gov.cz/společné-části-elektronických-dokumentů/2024-10-04/schémata/osoby/osoba-ve-vztahu-k-dokumentu.xsd"/>
  <xs:import namespace="http://dia.gov.cz/ns/spolecne-casti-elektronickych-dokumentu/osoby" schemaLocation="https://ofn.gov.cz/společné-části-elektronických-dokumentů/2024-10-04/schémata/osoby/fyzická-osoba-ve-vztahu-k-dokumentu.xsd"/>

The XSDs have both the same targetNamespace and contain no conflicting definitions. Nevertheless, the second import is ignored, resulting in an error:
{90310AA0-A8FD-4BC6-9C83-01261FF2DC72}

because that type is defined in the second imported XSD. When I comment out the first import, the second starts working.

This should be legal in XML Schema, and other validators like Altova work fine with it.

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 document1.xml and dokument-z-formuláře-ZoPDS.xsd, following its two imports of osoba-ve-vztahu-k-dokumentu.xsd and fyzická-osoba-ve-vztahu-k-dokumentu.xsd. Trace the XML Schema import and validation entry point; done means both same-namespace schemas are processed and the type from the second schema resolves without the reported error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.