导入dtd约束、手动添加 schema文件

这里先现在转载一篇博主的文章:https://blog.csdn.net/mimm249/article/details/77966343

 

我们开发时,经常会用到XML文件,尤其是用框架的时候,有时候xml文件总是会有警告,说

我们没有导入约束,于是这里讲一下怎么手动导入dtd、schema文件。

 

这里以导入hibernate的hibernate-configuration-3.0.dtd 和spring的schema文件

1.路径:windwos->preferences->myeclipse->files and editors->xml->xmlcatalog

->User Specified Entries窗口,点击Add按钮

2.选择dtd文件的路径,在Add XML Catalog Entry 对话框中选择或输入以下内容:

手动添加 schema文件操作如下:

windwos->preferences->myeclipse->files and editors->xml->xmlcatalog

点击“add”-->点击"File system..."按钮-->分别选择本地磁盘中的文件:

spring-beans-4.3.xsd,

spring-context-4.3.xsd,

spring-aop-4.3.xsd

一次选择一个文件,至于下面的“key type”和“key”两个选项不用管,会自动填充的。

---注意,要重启MyEclipse

猜你喜欢

转载自blog.csdn.net/lx678111/article/details/82944163