I have XSD file (for example) http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd and I would like to use it for adding code autocomplete in my xml editor (I prefer Eclipse bu
It is supported by default in Eclipse. You just need to add XSI and schemaLocation as the following example.
As you can see above, you have need 3 attributes. The autocomplete works because of the valid xsd hosted on a public url and provided in the xsi:schemaLocation attribute
Note that all Editors don't support this by default, but Eclipse and Netbeans I know do.
Reference: https://metamug.com/article/auto-complete-xml-editor-with-xsd-and-validations.php