Let's go inside

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

          導航

          常用鏈接

          留言簿(4)

          隨筆分類(60)

          隨筆檔案(59)

          J2EE相關技術

          個人空間

          友情鏈接

          搜索

          •  

          積分與排名

          • 積分 - 41127
          • 排名 - 1143

          最新評論

          閱讀排行榜

          XMLBuddy配置

          Posted on 2006-07-17 13:18 Earth 閱讀(1011) 評論(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文件,給出代碼提示,非常棒。。。

          主站蜘蛛池模板: 呼图壁县| 景东| 穆棱市| 西乡县| 内乡县| 宁都县| 肇州县| 赤水市| 陈巴尔虎旗| 三明市| 德昌县| 裕民县| 东乌| 安庆市| 沁阳市| 宜都市| 鹿邑县| 韶关市| 金堂县| 栾川县| 寿宁县| 宁安市| 南通市| 阿克苏市| 曲周县| 喜德县| 政和县| 昌图县| 奎屯市| 安丘市| 广西| 崇州市| 邯郸市| 翁源县| 包头市| 南召县| 康马县| 肃宁县| 文安县| 政和县| 金华市|