How to make eclipse not load XSD?

Every time I open an xsd ad file (e.g. Seam components.xml ) Eclipse starts downloading xsd files, Seam is very modular, so it uses 10 xsd files. How to make Eclipse not download these files or download them once (maybe it cannot download it because the plugin does not use the proxy server configuration) or even download it for it to put them in some directory?

PS I do not know if its JBossTools is defined, perhaps its behavior is inherited from the WTP plugin.

+4
source share
4 answers

The XML directory should work. This is its assigned function. Make sure that you add the correct entries and include schemas that indirectly reference other schemas.

When entering XSD files into a directory, you need to know the URL at which the file will be accessed. If you enter it under the wrong URL, it will not be found in the directory and Eclipse will gain access to the Internet to try and find it. To find out which URL to use, look at your XML files that reference these schemas. If there is a schemaLocation attribute, it will tell you the url. Otherwise, use the namespace URL.

The plugin can also make entries in the XML directory. If JBoss Tools provides tools for Seam, it should ideally send the XSD files it needs in the plugin and automatically register them in a directory. You might want to open an improvement request in JBoss Tools.

+3
source

I think you can create an entry in Eclipse to link to XSD locally.

Window> Preferences> XML> XML Catalog

+1
source

They must use the full URL, including the name of the XSD file in the namespace key. Just using the namespace does not work.

Open the Eclipse settings, go to the XML Catalog and add each xsd manually by selecting it from the file system.

And you do not need to restart eclipse (I use 3.6+), but you may need to rebuild your project.

You can also programmatically add one or more XSD files to your project, but this may not help you in the automatic completion.

A related question with the Eclipse plugin: How to add the XSD directory to Eclipse directly

+1
source

In my case, I used the XML Catalog, as suggested by Konstantin Komissarchik, but I also had to remove the schemaLocation attributes in each <import> -Statement in each XSD file. The reason is explained here http://wiki.eclipse.org/Using_the_XML_Catalog#FAQ

I registered an XML namespace schema, but the XML files still use the value "xsi: schemaLocation". Why? An explicit schema location value takes precedence over XML catalog entries that are associated with a namespace.

0
source

Source: https://habr.com/ru/post/1333465/


All Articles