简体   繁体   English

Eclipse Indigo XML编辑器无法打开带有其他扩展名的正确XML文件

[英]Eclipse Indigo XML editor doesn't open proper XML files with other extensions

So I have a proper xml file with the ending .xcs When I try to open it, it give me "Unsupported Contend Type" message. 因此,我有一个以.xcs结尾的正确xml文件,当我尝试打开它时,它显示了“不受支持的竞争类型”消息。 There it tells me to go to the "Content Type Preference Page" and set the default editor for my file ending. 在那里,它告诉我转到“内容类型首选项页面”,并为文件结尾设置默认编辑器。

Now first, this shouldn't happen, because I was specifically opening the file with the XML editor. 现在首先,这不应该发生,因为我专门使用XML编辑器打开文件。

Anyway, I go to the Content Type Prefs Page and set the .xcs ending to be opened with XML Editor by default. 无论如何,我都转到“内容类型首选项”页面,并将.xcs结尾设置为默认情况下使用XML编辑器打开。

Same message when I try to open the file, and when it opens in the XML Editor, the elements don't appear, but instead I get "The document is empty. Right click here to insert content". 当我尝试打开文件,并在XML编辑器中打开文件时,出现相同的消息,但没有出现元素,而是显示“文档为空。右键单击此处插入内容”。

One more thing: if I rename my file to .xml it opens without problems. 还有一件事:如果我将文件重命名为.xml,它可以正常打开。

this solution worked for me 这个解决方案对我有用

https://bugs.eclipse.org/bugs/show_bug.cgi?id=288239 https://bugs.eclipse.org/bugs/show_bug.cgi?id=288239

You will need to change the content type for XML to include the extension .xcs. 您将需要更改XML的内容类型以包括扩展名.xcs。 You can do this by going to Window > Preferences. 您可以通过转到窗口>首选项来执行此操作。 Expand the tree to General > Content Types. 将树扩展到“常规”>“内容类型”。 Under the Content Types tree, expand Text and search for XML. 在“内容类型”树下,展开“文本”并搜索XML。 Select XML, and then press the "Add..." button. 选择XML,然后按“添加...”按钮。 In the Content Type field type "*.xcs". 在内容类型字段中,输入“ * .xcs”。 Press OK. 按确定。 Press OK again to save the preference. 再次按OK保存首选项。 The .xcs extension should now be associated with the XML content type and the file should open properly in the XML editor. 现在,.xcs扩展名应与XML内容类型相关联,并且该文件应在XML编辑器中正确打开。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM