myeclipse 10 add dtd used by xml file


1. Open MyEclipse and find the menu bar "Window"---->"Preferences";

2. Find "MyEclipse"---->"Files and Editors"---->"XML"--->"XML Catalog" in the left navigation menu bar;

3. In the interface on the right, select "User Specified Entries", and click "Add..." on the right;

4. In the pop-up "Add XML Catalog Element" dialog box, click "File System..." to add the path of the DTD file to the Location input box, or click "Workspace" to add the path of the DTD file to the Location input box ;

5. Use a text editor to open this DTD file and find the corresponding <!DOCTYPE ...> document type declaration,

For example, the Hibernate configuration file: The DTD file required by hibernate.cfg.xml is:

hibernate-configuration-3.0.dtd

    After opening hibernate-configuration-3.0.dtd, find the following:

<!DOCTYPE hibernate-configuration PUBLIC

"-//Hibernate/Hibernate Configuration DTD 3.0//EN"

"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

6. The drop-down box on the right of "Key Type:" (there are three types: Public ID, System ID, URI),

According to PUBLIC in <!DOCTYPE...> in hibernate-configuration-3.0.dtd,

Select Public ID (or directly select "URI");

7. In the text box to the right of "Key:", put the <!DOCTYPE...> in hibernate-configuration-3.0.dtd

Copy the content in the double quotation marks after PUBLIC in, and then paste it into the text box to the right of "Key:",

Note that the content of COPY does not have double quotes "";

8. Click "OK", you can see that "User Specified Entries" has added DTD (KEY);

Similarly, the addition of hibernate-mapping-3.0.dtd, the DTD, can also be followed;

9. Restart MyEclipse. Note that if the prompt does not come out,

 And "Content Assist not available at the current location" appears at the bottom left of the status bar,

Please type a space at the cursor position and use Alt+/ to try;



Guess you like

Origin blog.csdn.net/Amos_liu/article/details/50808961
DTD