Main Tutorials

dtd content assist is not working in Eclipse IDE editor?

Problem

Recently, i have installed an Aptana plugins in Eclipse IDE, after that , when i pressed “ctrl + space” in a Struts 2 xml file, the content assist is not working anymore. See picture :

dtd not working

The content assist is not suggesting any Struts 2 elements, even the Struts 2 dtd is included correctly in the beginning of the xml file.


<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
...

Solution

After many tries and errors, i found out this is caused by the Apatana XML editior. When you double clicks on the xml file, Eclipse will always use back the last used xml editor to open it, in this case, it is Apatana XML editor (the content assist is not working in this editor).

The solution is quite simple, just use the normal Eclipse’s XML editor to open the xml file. Right on the xml file, and choose the normal XML editor. Done, See picture :

dtd working

Now, the content assist is working properly.

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
2 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Deirdra strangio
11 years ago

Thanks! This is great. I have a question, is there a safe way to use the file association prefrence not to open any XMLs via the Aptana editor?

kumar
11 years ago

i was suffering with this issue ,, thanks for solution