Skip to content
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

Location of Schema used for current xml file unclear #368

Open
minstreldragon opened this issue Feb 15, 2024 · 1 comment
Open

Location of Schema used for current xml file unclear #368

minstreldragon opened this issue Feb 15, 2024 · 1 comment

Comments

@minstreldragon
Copy link

I am working with a standard that has quite a few revisions of its Schema: AUTOSAR (autosar.org)

When opening an ARXML file in XML Notepad the tool shows me the auto completion and does on-the-fly verification.
However, it is not clear to me which exact schemal version i.e. xsd file XML Notepad is using: While I see one version in the View/Schemas... dialog, this is sometimes clearly not the revision of the schema that is used internally: the two schema revisions have different elements, and I get elements in the auto-completion for my xml file that are not present in the schema revision that is indicated in the View/Schemas dialog).

Is XML Notepad buffering schemas in the background, or pulling them from the registry or something like this? If yes, what is the logic behind this?

In particular it would be good if XML Notepad would support the following use cases:
(1) I want to provide XML Notepad with the exact schema file I want to use when editing an xml file.
(2) I want to have an indication somewhere in the program of which exact schema file is currently being using.

Thank you for this tool. I have been using it for years, and I am generally very happy with it. However, the schema issue described keeps giving me trouble.

@lovettchris
Copy link
Member

lovettchris commented Feb 28, 2024

Hi Markus, thanks for your question. If you can provide a simple reproducable set of XML and XSD files so I can debug this problem that would help.

To answer your questions:

  1. XML notepad is not buffering schemas anywhere, but it does remember schemas it has seen before in the Settings.xml file, so you could try and edit that file and remove all past schemas it has listed there, or select File/Clear menu item from the Schemas... dialog.
  2. XML notepad will honor the schema specified in the xsi:schemaLocation attribute first, then it matches by XML namespace to any previously seen schema. If there are multiple versions of the schema with the same namespace, then there is no guaranteed order in which it will pick a matching schema (it's a hashtable).
  3. Good idea, I will add this feedback in the Schema dialog so you can see which schemas are being applied and perhaps provide a UI so you can change that decision.

Glad you like the tool,
Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants