microsoft/XmlNotepad

Location of Schema used for current xml file unclear

minstreldragon opened this issue · 1 comments

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.

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.