lemminx icon indicating copy to clipboard operation
lemminx copied to clipboard

Supported URI-Schemes in Catalog-Files

Open blasss opened this issue 2 years ago • 5 comments

I'm currently considering to contribute a PR for [https://github.com/eclipse/wildwebdeveloper/issues/1078] and therefore would like to check what kind of URI-schemes ('protocols') are supported for schemas in XML catalog files. Basically I would assume this will be handled by Xerces and therefore should be able to cope with any scheme that is supported by standard Java.

Is there any additional processing in LemMinX that would restrict the list of supported schemes?

Practically jar:-URIs will be involved and are working in my environment from what I can tell. But I would like to check to avoid pure coincidence...

blasss avatar Feb 09 '23 10:02 blasss

Today we support file, http, https scheme but Im not sure that xerces support jar scheme.

Could you attach a simple jar which could contains an xsd and an xml file which is linked to the xsd coing from the jar. Thanks

angelozerr avatar Feb 09 '23 22:02 angelozerr

I attached lemminx_1477.zip with the following content:

  • acme.jar - jar with a xsd located in com/acme/order/order.xsd
  • order.xml - example xml-file that uses the schema
  • system-catalog.xml - catalog-file that references the order.xsd with a jar:-URI. Unfortunately it requires to put the archive in the correct place (C:/temp/acme.jar)...

The xml-file was created using the xsd and should therefore be perfectly valid. The catalog-file lacks testing so far.

blasss avatar Feb 10 '23 18:02 blasss

Thanks @blasss for your sample. Let' sme investigate how LemMinx can support that.

angelozerr avatar Feb 14 '23 16:02 angelozerr

@blasss have you tested your sample in WWD? Have you some validation error, completion based on XSD?

I have tested quickly with vscode-xml and I have some error validation, and completion based on XSD.

The jar:file protocol seems working.

angelozerr avatar Feb 14 '23 21:02 angelozerr

Sorry for being a little late to the party. I tested with WWD and a catalog-file with a jar-file entry.

On a rough first look the support seems to be working. I want to make sure I didn't miss something and there is some official support for this.

As the aforementioned PR will be based on this functionally, it's crucial this is not simply working by coincidence and will vanish some time in the future as nobody recognizes this to be used in dependent projects....

blasss avatar Feb 22 '23 16:02 blasss