1

I have an xml file but the extension is ".agen". Is there a way to make Eclipse recognize the file extension and display the content as xml?

Johann
  • 27,536
  • 39
  • 165
  • 279

1 Answers1

2

Window->Preferences->General->Editor->File Associations

Sergey Morozov
  • 4,528
  • 3
  • 25
  • 39
  • A very strange thing happens when I do that. After adding the file extension and I open the file, the first line of the file shows . If I rename the file to .xml and open it, those first 3 characters are gone. Any reason why? It's as though it can't read the correct encoding. – Johann Jul 08 '14 at 05:51
  • Seems, your file contains BOM for recogneze UTF-8 encoding: http://stackoverflow.com/questions/4614378/getting-ï-at-the-beginning-of-my-xml-file-after-save. If you associate xml-editor for extensions .agen then this 3 charactes will go. – Sergey Morozov Jul 08 '14 at 05:54
  • OK, but why does it open correctly just by adding the .xml extension? – Johann Jul 08 '14 at 05:57