Skip to content

Invalid xsd for the associated tag #2139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
apupier opened this issue Mar 27, 2025 · 3 comments
Closed

Invalid xsd for the associated tag #2139

apupier opened this issue Mar 27, 2025 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@apupier
Copy link
Member

apupier commented Mar 27, 2025

Describe the Bug

the provided xsd for Camel spring does not contain the top-level camel tag so the xml is invalid compared to its xsd declaration:

<?xml version="1.0" encoding="UTF-8"?>
<camel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://camel.apache.org/schema/spring" xsi:schemaLocation="http://camel.apache.org/schema/spring https://camel.apache.org/schema/spring/camel-spring.xsd">
    <route id="route-3075">
        <from uri="timer:xml?period=1000"/>
        <setBody>
            <simple>
                Hello Camel from ${routeId} &lt;
            </simple>
        </setBody>
        <log message="${body}"/>
    </route>
</camel>

the error reported on the camel tag: cvc-elt.1.a: Cannot find the declaration of element 'camel'.xml(cvc-elt.1.a)

it is making it worse than removing it as it was before #2087

The specific xsd for this way of writing the xml must be provided, not the camel-spring one. (and if if does not exists, it needs to be reported upstream to provide one)

Steps to Reproduce the Bug or Issue

  1. create an xml file
  2. to see the error use a tooling for xml such as VS Code xml

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: 2.5.0-M4
@apupier apupier added the bug Something isn't working label Mar 27, 2025
@lordrip lordrip moved this from New to Todo in Kanban Board Apr 1, 2025
@apupier
Copy link
Member Author

apupier commented Apr 1, 2025

Image

@lordrip lordrip added this to the 2.5.0 milestone Apr 1, 2025
@apupier
Copy link
Member Author

apupier commented Apr 1, 2025

it was a problem of the xsd cached. To fix it, go to ~/.lemminx/cache/https/camel.apache.org and deleted this folder, then reopen.

for reference where the xsd is cached https://github.com/redhat-developer/vscode-xml/blob/main/docs/Preferences.md#server-cache-path

@apupier apupier closed this as completed Apr 1, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Kanban Board Apr 1, 2025
@apupier
Copy link
Member Author

apupier commented Apr 1, 2025

the camel top-level attribute tag was added not that long ago (maybe around 4.8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants