Let's go inside

this blog is deprecated as a result of laziness.
posts - 59, comments - 2, trackbacks - 0, articles - 0

XMLBuddy配置

Posted on 2006-07-17 13:18 Earth 阅读(995) 评论(0)  编辑  收藏 所属分类: Java

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中加入

< file >
< pub > -//SPRING//DTD BEAN//EN </ pub >
< abs > http://www.springframework.org/dtd/spring-beans.dtd </ abs >
< rel > spring-beans.dtd </ rel >
</ file >

< file >
< pub > -//Hibernate/Hibernate Mapping DTD 3.0//EN </ pub >
< abs > http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd </ abs >
< rel > hibernate-mapping-3.0.dtd </ rel >
</ file >

< file >
< pub > -//Hibernate/Hibernate Configuration DTD 3.0//EN </ pub >
< abs > http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd </ abs >
< rel > hibernate-configuration-3.0.dtd </ rel >
</ file >

< file >
< pub > -//ANT 1.6.5/DTD//EN </ pub >
< abs > http://xmlbuddy.com/DTD/ant165.dtd </ abs >
< rel > ant165.dtd </ rel >
</ file >


前三者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):

<? xml version="1.0" ?>
< project  default ="dtd" >
 
< target  name ="dtd" >
  
< antstructure  output ="ant.dtd" />
 
</ target >
</ project >

OK,接下来,选择window->preferences->XMLBuddy->XML->Validation->DTD然后new 三个"assume DTD if root matches"分别是hibernate-mapping, hibernate-configuration, beans这样在写xml文件时只要指定了root名,XMLBuddy就会自动关联到预先指定的DTD文件,给出代码提示,非常棒。。。


只有注册用户登录后才能发表评论。


网站导航: