Using Xmlbuddy to develop XML in eclipse

Source: Internet
Author: User
Tags functions connect jboss
XML This article is mainly about how to support XML development in the Eclipse platform, focusing on the Xmlbuddy plug-in. Here is only a kind of not money, is xmlbuddy, it mainly provides for the DTD aspect of the validation, Code assistant, and other functions; there is also a money, is Xmlbuddy Pro, it extends a lot of functions relative to xmlbuddy, such as the schema , XSLT, RELAX NG support.  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 install 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 version 2.0.38: 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. Install the installation Xmlbuddy 2.0.38 unzip the downloaded file, and then copy com.objfac.xmleditor_2.0.38 to the plugins directory under the Eclipse installation directory, or you can use links to install it. To start eclipse again, you should be able to discover that Xmlbuddy is already installed. 3. Customization if you want to customize Xmlbuddy, you can use the window-> preferences->xmlbuddy to modify: Two, using Xmlbuddy to start explaining how to use xmlbuddy: Create a new Java project called "Xmlbuddydemo," and then create a web.xml file. As follows:
<?xml version= "1.0" encoding= "GBK"?> <! DOCTYPE Web-app Public "-//sun Microsystems, INC.//DTD Web Application 2.3//en" "Http://java.sun.com/dtd/web-app_2_3. DTD "><web-app><welcome-file-list><welcome-file>index.html</welcome-file></ Welcome-file-list></web-app>
· If you are not connected to the Internet at this time, the following figure: At this point, if you enter the code, there will be 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:
<?xml version= "1.0" encoding= "GBK"?> <! DOCTYPE Web-app Public "-//sun Microsystems, INC.//DTD Web Application 2.3//en" "Http://java.sun.com/dtd/web-app_2_3. DTD "><web-app><welcome-file-list><welcome-file>index.html</welcome-file></ welcome-file-list><error-page><error-code>404</error-code><location>/error.jsp</ Location></error-page></web-app>
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:
<?xml version= "1.0" encoding= "GBK"?> <! DOCTYPE Web-app Public "-//sun Microsystems, INC.//DTD Web Application 2.3//en" "File:///D:/xml/web-app_2_3.dtd" > <web-app><welcome-file-list><welcome-file>index.html</welcome-file></ Welcome-file-list></web-app>
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.    III, some digression     other plug-ins, such as Lomboz, jboss-ide, etc. although you can edit the XML file, but in terms of its performance, not as Xmlbuddy, here is not much to say.     But 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), at which point you can select the XML file you want to open, right-click, Select Xmlbuddy to open, and when the next time you open the XML file, Eclipse will call Xmlbuddy to operate 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 good for files with a DTD type of XML document, but not very good for files with XML document types that are in the world of XML Schema schemas, of course, You can use the Xmlbuddy Pro version, but it does not seem to work. 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, designed to develop Java EE and WEB applications, Of course, you can edit the XML file. Try a bit or very good, the following to give you a picture to solve the thirst:          in fact, I always think that XML file is a program and program to communicate a way, But it should not be a way of communicating with 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.