Using Xmlbuddy to develop XML in eclipse

Source: Internet
Author: User
Tags format functions connect version window jboss
XML here only introduces the Xmlbuddy, it mainly provides for the DTD aspect of the validation, Code assistant, and other functions; another is Xmlbuddy Pro, which extends a number of functions relative to xmlbuddy, such as support for schema, XSLT, RELAX NG, But it needs money. For the general writing of XML, Xmlbuddy is enough, and it's free and easy to get, so here's what it's all about.

   First, download and installation

1. Download

Xmlbuddy's home address is: http://www.xmlbuddy.com/

Download to note is Xmlbuddy, not Xmlbuddy Pro. Here is a download address, Xmlbuddy 2.0.38 Version:

Http://xmlbuddy.com/2.0/78945789020508924908525/8902390238490587584751/xmlbuddy_2.0.38.zip

Note: This version matches the Eclipse 3.0.1-3.1M5.

For ease of explanation, the version of Eclipse I used was 3.0.1, and the Chinese language pack was installed, and no other plugins were installed. As shown in figure:


2. Installation

Install Xmlbuddy 2.0.38, unzip the downloaded file, and then copy the com.objfac.xmleditor_2.0.38 directory to the plugins directory under the Eclipse installation directory, or use links to install it.

To start eclipse again, you should be able to discover that Xmlbuddy is already installed.

3. Custom

If you want to customize the Xmlbuddy, you can modify it through the window-> Preferences->xmlbuddy:

ii. use of Xmlbuddy

Here's how to use Xmlbuddy:

· Create a new Java project called "Xmlbuddydemo," and then create a web.xml file. As follows:

! DOCTYPE Web-app
Public "-//sun Microsystems, INC.//DTD Web application 2.3//en"
"Http://java.sun.com/dtd/web-app_2_3.dtd" >



index.html


· If the Internet is not connected at this time, the following figure:


At this point, if you enter the code, there is no code hint function.


· Connect the Internet, reopen the Web.xml file, pause for a moment (Xmlbuddy will automatically download WEB-APP_2_3.DTD), and then do the following:

>
You can also use "alt+/" for code hints.

· After the code is completed:

! DOCTYPE Web-app
Public "-//sun Microsystems, INC.//DTD Web application 2.3//en"
"Http://java.sun.com/dtd/web-app_2_3.dtd" >




index.html




404


/error.jsp




How, Convenient! Add:

If you open the "F1" file under the Eclipse directory \workspace\.metadata\.plugins\com.objfac.xmleditor\.cache (not necessarily F1 name, possibly F2, F3, etc.), Will find this file is web-app_2_3.dtd.

· If you cannot connect to the Internet, or if the links contained in the namespace are invalid, you can obtain WEB-APP_2_3.DTD files by other means, such as placing them in the D:/xml directory, and then referencing them directly, as follows:

! DOCTYPE Web-app
Public "-//sun Microsystems, INC.//DTD Web application 2.3//en"
"File:///D:/xml/web-app_2_3.dtd" >



index.html


You can try to place the namespace (ie!). DOCTYPE tag) is removed, as can be deployed in Tomcat.

· Xmlbuddy also has other functions, such as "format" code.


Three , some of the digression

Other plug-ins, such as Lomboz, Jboss-ide and so on, although you can also edit the XML file, but in terms of its performance, as the Xmlbuddy, here is not much to say.

However, one thing to note is that when multiple plug-ins are installed, the default way to open the XML file is not necessarily xmlbuddy (this is the result of installing jboss-ide), you can select the XML file to open, right-click, select Xmlbuddy Open, and the next time you open the XML file, Eclipse will invoke Xmlbuddy by default. Of course, you can also select other Plug-ins to open. You can also do this by modifying the default open mode of the XML File (Window-> Preferences-> Workbench-> File association), or even calling an external software (such as XML Spy) to manipulate the XML file (if you think the plug-ins are not appropriate).


In general, Xmlbuddy is pretty good for files with XML document types as DTD, but for files with XML document types that are in the format of the world-view XML Schema, it's not very good, of course, you can use the Xmlbuddy Pro version to edit, But it does not seem to be working. Fortunately, most of them are DTD, so Xmlbuddy is still used.

Now, there is a project under Eclipse, "Eclipse Web Tools Platform Project", the current version is 1.0m3, mainly used to develop Java EE and WEB applications, of course, you can edit the XML file. The trial is still very good, here is a map to solve the thirst for everyone:


In fact, I've always thought that XML files are a way to communicate between programs and programs, but not as a way of communicating between programs and programmers. I always think it is too wordy, really unbearable, with the Tang monk-like (a joke, relax). So I'm generally reluctant to write XML files, often using Xdoclet to generate XML files. These are off the topic, not wordy.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.