redhat-developer / redhat-developer/vscode-xml

XML catalog rewrite not applied to schemaLocation

Open
#534 3 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 don't know if this is a bug in this extension, in lemminx or in the definition...

Given a registered catalog definition of

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">

  <rewriteURI
      uriStartString="http://foo.web/foo/"
      rewritePrefix="./" />

</catalog>

And an xmlns="http://foo.web/foo/types.xsd" the file used for validation is the local types.xsd as expected, no downloading is done.

But with a given definition of xsi:schemaLocation="http://foo.web/foo http://foo.web/foo/types.xsd" the XML Support output pane says:

[Info  - 11:59:08] Jun 28, 2021 11:59:08 org.eclipse.lemminx.uriresolver.CacheResourcesManager lambda$downloadResource$0()
Message: Downloading http://foo.web/foo/types.xsd to C:\Users\me\.lemminx\cache\http\foo.web\foo\types.xsd...
[Error - 11:59:08] Jun 28, 2021 11:59:08 org.eclipse.lemminx.uriresolver.CacheResourcesManager lambda$downloadResource$0()
Message: Error while downloading http://foo.web/foo/types.xsd to C:\Users\me\.lemminx\cache\http\foo.web\foo\types : [sun.security.provider.certpath.SunCertPathBuilderException] unable to find valid certification path to requested target

So... where is the bug? If it is in the definition: What would be the correct approach?

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 XML catalog guidance in docs/Validation.md and reproduce the difference between xmlns schema resolution and xsi:schemaLocation using the catalog definition from the report. Trace the LemMinX resource-resolution output to determine where the rewrite is skipped, and consider the issue done when the schemaLocation case uses the local types.xsd without downloading it.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
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.