-1

There are a few languages, that developed shorthand notations, notably e.g. ECMAScript can be generated from coffeescript:

CoffeeScript is a little language that compiles into JavaScript. Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.

Are there any attempts or projects to do for XSLT what coffee represents for JavaScript? Any source-to-source compiler, transcompiler or transpiler? A project, whose description would be:

X is a little language that compiles into XSLT. Underneath that awkward XML-esque patina, XSLT has always had a gorgeous (functional) heart. X is an attempt to expose the good parts of XSLT in a simple way.

Update: Noticed a similar question on SO - but it is five years old.

miku
  • 1,508

1 Answers1

3

I have come across many attempts to create a "user-friendly" or "compact" non-XML syntax for XSLT over the years, and as far as I know, none of them was ever used by anyone except its inventor. Most of them have even disappeared from the web.

When you write in such a language you have some major usability difficulties to overcome. Chances are, there will be no editing tools (e.g. for auto-completion). Chances are, when you get error messages, they will be in terms of the generated XSLT rather than the original source. So why would anyone bother, just to save a few keystrokes or some perceived surface ugliness (are curly braces really that much more appealing than angle brackets?)

But there is another kind of front-end that has more justification: there's sometimes a need for a special-purpose transformation language oriented to specific tasks. I created one once specifically for conversion of Excel spreadsheets. You can create a nice custom language for that kind of task, and then implement it by either compiling it into XSLT, or by writing an interpreter in XSLT.

Michael Kay
  • 3,599
  • 1
  • 17
  • 13