redhat-developer / redhat-developer/vscode-xml

Schema Validation Error Despite Successful Catalog Resolution

Open
#1,058 0 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

Description

While the XML catalog successfully resolves relative schema paths (evidenced by working Ctrl+Click navigation and IntelliSense), the extension still shows validation errors claiming it cannot find element declarations that exist in the resolved schema.

Steps to Reproduce

  1. Create an XML file (foo.xml):
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<vehicle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../shared/xml/schema/vehicle.xsd">
  1. Create catalog.xml:
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
    <rewriteURI 
        uriStartString="../../../../shared/xml/schema/"
        rewritePrefix="file:///C:/Program Files (x86)/path/to/shared/xml/schema/" />
</catalog>
  1. Configure VS Code settings.json:
"xml.catalogs": [
    "path/to/catalog.xml"
]

Expected Behavior

  • Catalog resolution works (it does!)
  • Schema validation works using the resolved schema
  • No validation errors for elements that are defined in the schema

Actual Behavior

  • Catalog resolution works correctly:
    • Ctrl+Click on schema path opens correct file
    • IntelliSense features work
  • BUT still get validation error: "Cannot find the declaration of element 'vehicle'"
    • This error appears despite the element being defined in the successfully resolved schema

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 issue with foo.xml, catalog.xml, the shown xml.catalogs setting, and the referenced vehicle.xsd. Compare the successful Ctrl+Click and IntelliSense resolution with the validation path; done means the resolved schema is used and the false 'Cannot find the declaration' error no longer appears.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode, xml
Domain
devtools
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.