【发布时间】:2014-02-24 17:14:27
【问题描述】:
我正在为 Eclipse 开发一个插件,其中一个功能是能够编辑 XML。为此,我必须在 Eclipse 目录中添加 XSD。 有没有一种简单的方法可以直接将 XSD 添加到 Eclipse 目录(我的意思是直接通过代码)
【问题讨论】:
我正在为 Eclipse 开发一个插件,其中一个功能是能够编辑 XML。为此,我必须在 Eclipse 目录中添加 XSD。 有没有一种简单的方法可以直接将 XSD 添加到 Eclipse 目录(我的意思是直接通过代码)
【问题讨论】:
您可以使用org.eclipse.wst.xml.core.catalogContributions 扩展点(这要求您安装了Eclipse 的Web Tools (WST) 组件。
以下是org.eclipse.wst.xsd.core插件所做的贡献:
<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>
【讨论】: