Added the ibatis DTD file to eclipse to implement the XML automatic prompt function.

Source: Internet
Author: User
From http://danne823.iteye.com/blog/847706
Take ibatis to write the SQL map config configuration file as an example, add the sql-map-config-2.dtd to eclipse, so as to obtain the function of XML automatic prompt, better according to ibatis official definition of the specification to write XML documents.
Remember that there is such a sentence in XML. <! Doctype sqlmapconfig public "-// ibatis.apache.org//dtd SQL map config 2.0/EN"
Http://ibatis.apache.org/dtd/sql-map-config-2.dtd>
  1. Open Window --> preferences --> XML catalog in eclipse
  2. Click Add. The dialog box is displayed.




Location: Enter the local location of the downloaded DTD file;


Select public ID for key type;


Enter the key in the XML document header <! Those after doctype sqlmapconfig public.



Done!


Now create an XML pipeline ~~



 


The results are very convenient ~~



If not, check the input...


Remember to change the XML open mode to XML editor.



 


The following describes some knowledge about XML and DTD.




Why is adding a DTD so powerful...

Let's take a look at Baidu encyclopedia's definition of DTD:

(Document Type Definition)

DTD is a set of syntax rules for tags. It is part of the xml1.0 specification and is a validation mechanism for XML files. It is part of an XML file.

DTD is an effective method to ensure that the XML document format is correct. You can compare the XML document and DTD file to see whether the document complies with the specifications, and whether the elements and labels are correctly used.
.

The XML file provides an application data exchange format. The DTD makes the XML file a standard for data exchange.
Because different companies only need to define standard DTD, and each company can establish and verify XML files according to the DTD, so that they can easily establish standards and exchange data, this satisfies network sharing and data interaction.

A dtd is an ASCII text file with the suffix. DTD.

 

 

 

For XML files of different purposes, you must define a set of DTD documents to standardize the XML files written by users.

Take the sqlmap file of ibatis as an example.

 

<Span style = "font-size: small;" mce_style = "font-size: small;"> <! Doctype sqlmap public "-// ibatis.apache.org//dtd SQL map 2.0/EN" <br/> "http://ibatis.apache.org/dtd/sql-map-2.dtd"> </span>

! Doctype specifies the document type definition (DTD) that the document complies with, indicating that the XML document is parsed In the DTD mode.

The string "-// ibatis.apache.org//dtd SQL map 2.0 // en" followed by public indicates the specified DTD file, which can be viewed as a unique identifier.

"Http://ibatis.apache.org/dtd/sql-map-2.dtd" is the address of the DTD file on the official website


We can use this official website address to download the corresponding DTD file and add it to eclipse.

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.