如何将XSD直接添加到Eclipse目录 [英] How to add an XSD to Eclipse catalog directly

查看:225
本文介绍了如何将XSD直接添加到Eclipse目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Eclipse开发一个插件,其功能之一是能够编辑XML.为此,我必须在Eclipse目录中添加XSD. 是否有一种简单的方法可以直接将XSD添加到Eclipse目录中(我的意思是直接通过代码)

I am developing a plugin for Eclipse, one of the features is to be able to edit XML. In order to do that I have to add the XSD in Eclipse catalog. Is there an easy way to add an XSD to Eclipse catalog directly (I mean directly through code)

推荐答案

您可以使用org.eclipse.wst.xml.core.catalogContributions扩展点(这需要安装Eclipse的Web工具(WST)组件.

You can use the org.eclipse.wst.xml.core.catalogContributions extension point (this requires that you have the Web Tools (WST) component of Eclipse installed.

以下是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>

这篇关于如何将XSD直接添加到Eclipse目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆