Question

I would like my Eclipse plug-in to specify a XSD file to Eclipse so it can be added to the catalog.

Était-ce utile?

La solution

The org.eclipse.wst.xml.core.catalogContributions extension point lets you add to the catalog (this requires that you have the Web Tools (WST) component of Eclipse installed).

For example the org.eclipse.wst.xsd.core plugin adds this:

<extension
    point="org.eclipse.wst.xml.core.catalogContributions">
    <catalogContribution id="default">
        <uri
             name="http://www.w3.org/2001/XMLSchema"
             uri="platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/XMLSchema.xsd" />
        <system
             systemId="http://www.w3.org/2001/xml.xsd"
             uri="platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd"/>             
   </catalogContribution>
</extension>

Autres conseils

It reads them from an extension point. org.eclipse.wst.standard.schemas and org.eclipse.jst.standard.schemas (both from the Web Tools Platform and installed with the Java EE IDE) contain many examples. Since there's no compiled code in those plug-ins, you can just study the installed copies.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top