---
title: "MyEclipse添加XML的xsd文件和dtd文件 "
author: "digilover"
date: "2012-04-20T10:00:07Z"
tags: []
categories: ["Web前端"]
slug: "myeclipse-xml-xsd-dtd"
draft: false
lastmod: "2012-04-20T10:00:07Z"
id: 1491028
url: "https://digilover.iteye.com/blog/1491028"
---

以添加spring的spring-beans-2.0.xsd为例：

1：Preferences-&gt;MyEclipse-&gt;XML-&gt;XML Catalog-&gt;选中User Specified Entries-&gt;点击Add；  
2：Add XML Catalog Entry窗口：Key Type选择URI，Location选择File System选中dist\\resources\\文件夹下的spring-beans-2.0.xsd；  
3：Add XML Catalog Entry窗口：Key Type选择Schema Location，Key路径在后面加上/spring-beans-2.0.xsd；

以添加struts2的struts-2.0.dtd为例：

1：Preferences-&gt;MyEclipse-&gt;XML-&gt;XML Catalog-&gt;选中User Specified Entries-&gt;点击Add；  
2：Add XML Catalog Entry窗口：Key Type选择URI，Key路径在后面加上[http://struts.apache.org/dtds/struts-2.0.dtd]() ；  
3：Add XML Catalog Entry窗口：Location选择File System选中struts-2.1.8.1\\lib\\struts2-core-2.1.8.1\\struts-2.0.dtd；