marijnh/CodeMirror2 — Issue #427: Supporting XML-based mime types
Author: jankeromnes
Created: 2012-03-05 22:35:10+00:00
State: open

A lot of file formats are based on XML, and they usually have a specific mime type. [RFC 3023] (http://tools.ietf.org/html/rfc3023) recommends that these mime types end with `+xml`. Here are some of them:

- `image/svg+xml`
- `application/atom+xml`
- `application/rdf+xml`
- `application/rss+xml`
- `application/soap+xml`
- `application/vnd.mozilla.xul+xml`
- `application/vnd.google-earth.kml+xml`
- `application/wsdl+xml`
- `application/xhtml+xml`
- `application/xop+xml`
- `message/imdn+xml`
- `model/x3d+xml`

It could be a good idea to support such mime types in CodeMirror, using the already existing XML mode. I would have made this a pull request, but first I would like to know if there is a way not to copy paste all those mime types into hard code, i.e. by detecting a mime type ending in `+xml` instead of putting all these types into the XML mode?