Unable to edit xml files but can edit .java?
Hi I have开发者_如何学Python a strange problem.
I'm working on an existing project which I have imported into eclipse. I can view all files. There are no errors being indicated. I can run the project and it will show on the emulator.
When I attempt to change the code in the xml file, in fact, all xml files, nothing gets typed in, no characters, no space, no new line. nothing. I even tried making a new xml files, and I couldn't edit it.
Surprisingly, I can edit the .java files.
I hope this is just something stupid on my behalf but anyone help would be appreciated.
Thanks.
Do you have the XML editor/perspective available in Eclipse? I recall that this package was missing from the version of Eclipse available on Ubuntu 9.10 and had to be installed manually.
To see if you have it, either: check if "XML" is in the list of perspectives from "Window"->"Open Perspective"->"Other...". Or else go to "Help"->"Install New Software" and then click the "What is already installed?" link in the resulting dialog - you're looking for something like "Eclipse XML Editors & Tools".
If you can't find it then you could try installing it from the appropriate software site for your version of Eclipse (for example I'm using 3.5.1 aka Galileo so the site is http://download.eclipse.org/releases/galileo/), via the "Help"->"Install New Software" dialog.
Right click on any XML file and select Open With menu. What do you see checked there? It should either be "XML Editor" or "Text Editor". If it's anything else, some plugin has taken over editor association for XML files. You can fix that in the Open With menu.
If association looks correct, the next thing to try is to open the Error Log view and watch it as you attempt to type into the editor. It could be that you are running into some bug and capturing the stack trace will help. Make sure you clear the error log first.
I've just worked with someone who ran across this and had this in their Error Log:
java.lang.AbstractMethodError: org.eclipse.wst.sse.ui.EditorExecutionContext.execute(Lorg/eclipse/core/runtime/ISafeRunnable;)V at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.startRewriteSession(JobSafeStructuredDocument.java:221)
This means all XML, DTD, CSS, HTML, and JSP files will not edit properly.
The underlying cause is that somehow the installation's been broken and the org.eclipse.wst.sse.core and org.eclipse.wst.sse.ui plug-ins no longer match as they should. This can happen if you're installing plug-ins and searching an older site like Helios or Galileo but are actually running Indigo. Between all of the plug-in dependency ranges, that might have been the only solution that satisfied everyone. Newer versions of org.eclipse.wst.sse.ui are more strict about which versions of org.eclipse.wst.sse.core they will work with to help minimize occurrences of this problem.
Don't add sites for an Eclipse Simultaneous Release other than the one you're already on. Be wary of anything that says you must.
I usually face this problem in Eclipse when I try to open XML files, the editor just remains blank but I have the XML editors installed in my Eclipse copy. Just restarting the Eclipse solved the issue for me on many instances. This is for someone who has the editors installed but still faces the same issue as mentioned in this thread.
精彩评论