Written by

IRIS Developer Advocate, Software developer at CaretDev, Tabcorp
Question Dmitry Maslennikov · Feb 18, 2016

XData MimeType anything other then just xml

XData blocks in Caché classes has a MimeType property, and dcoumentation says

MimeType — The MIME type (more formally, the internet media type) of the contents of the XData block. The default is text/xml

But unfortunately I can't set any other values, such as text/html or application/javascript, because XData still expect only XML. 

So, question is, for what reasons this property was appeared?

It would be very usefull to set in this property anything other then text/xml, and Studio would highlighted it as developer expected.

Comments

Timur Safin · Feb 18, 2016

Good question, it would be nice to know the list of supported (i.e. properly syntax highlighted) mimetypes.

I know that application/json is [almost] properly handled (with the exception of open brace). But what else? Even text/plain is marked invalid.

Class CPM.Sample.PackageDefinition Extends CPM.Utils.PackageDefinition{XData Package [ MimeType = application/json ]{{
        "name": "cpm-embedded-package-sample",
        "description": "CPM package sample with the embedded paсkage definition",
        "author": "tsafin",
        "version": "0.5.0",
        "license": "MIT",
        "dependencies": {
            "async": ">= 0.2.10",
            "fsplus": ">= 0.1.0",
            "language-cos": "https://github.com/UGroup/atom-language-cos.git"
        }
    }}}
0
Brett Saviano  Feb 14, 2023 to Timothy Leavitt

Here's a full list of all the MimeTypes that will be correctly colored in VS Code (requires InterSystems Langauge Server version 2.1.1):

  • application/json
  • text/html
  • text/javascript
  • text/css
  • application/sql
  • text/x-java-source
  • application/python
  • text/x-python
  • text/xml
  • application/xml

An XData bock with no MimeType will still be colored as XML.

0