XmlBuddy使手寫ant,spring, hibernate等具有DTD文件的xml配置文件成為可能!是Eclipse下不可多得的插件。下載XMLBuddy的配置文件及本例中出現的DTD文件: download D:\eclipse\myplugins\xmlbuddy\eclipse\plugins\com.objfac.xmleditor_2.0.72\.cache\meta.xml中加入
前三者DTD直接到網上下并copy到.cache目錄 Where Is Ant's DTD? One of the first things I noticed about Ant was that it didn't have an explicit DTD available in the archives I downloaded, either the binary or source archive. I wanted to see Ant's DTD so I could figure out what went into a build file. Then I discovered the antstructure task. This task in essence extracts a DTD from Ant's source code.
The following snippet is a simple Ant build file that uses the antstructure task (build-dtd.xml in the example archive):
OK,接下來,選擇window->preferences->XMLBuddy->XML->Validation->DTD然后new 三個"assume DTD if root matches"分別是hibernate-mapping, hibernate-configuration, beans這樣在寫xml文件時只要指定了root名,XMLBuddy就會自動關聯到預先指定的DTD文件,給出代碼提示,非常棒。。。
Powered by: BlogJava Copyright © Earth