[MonoDevelop] Trouble with XML plugin in 0.13

Matt Ward ward.matt at gmail.com
Tue Mar 27 14:47:54 EDT 2007


Currently the XML Editor only supports the mime type "text/xml", but
according to RFC 3023 the mime type "application/xml" may be a valid
for an XML document:

"The media types text/xml and application/xml MAY be used for document entities"
"Application/xml is preferable when the XML MIME entity is unreadable
by casual users."

Even though application/xml should be used when the XML "is unreadable
by casual users" I can add support for it in the XML Editor addin.

I could be wrong, but looking at the source code for MonoDevelop the
text editor does not necessarily open all mime types:

SourceEditorDisplayBinding.cs

public virtual bool CanCreateContentForMimeType (string mimetype)
{
	if (mimetype == null)
		return false;
	if (mimetype.StartsWith ("text"))
		return true;
	if (mimetype == "application/x-python")
		return true;
	if (mimetype == "application/x-config")
		return true;
	if (mimetype == "application/x-aspx")
		return true;

	// If gedit can open the file, this editor also can do it
	foreach (DesktopApplication app in DesktopApplication.GetApplications
(mimetype))
		if (app.Command == "gedit")
			return true;
			
	return false;
}

Regards,

Matt


More information about the Monodevelop-list mailing list